This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28654 - [FO31] load-xquery-module error codes
Summary: [FO31] load-xquery-module error codes
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 17:20 UTC by Debbie Lockett
Modified: 2016-12-16 19:55 UTC (History)
1 user (show)

See Also:


Attachments

Description Debbie Lockett 2015-05-18 17:20:54 UTC
The fn:transform() function definition (16.3.2) contains the following error conditions:

A dynamic error is raised [err:FOXT0001] if the transformation cannot be invoked because no suitable XSLT processor is available.

A dynamic error is raised [err:FOXT0002] if an error is detected in the supplied parameters (for example if two mutually-exclusive parameters are supplied).


Should there be similar specific error codes defined for the fn:load-xquery-module function (16.3.1)?

i.e. 1. Dynamic error if the query cannot be loaded because no suitable XQuery processor is available.

2. Dynamic error for errors detected in the parameters supplied in the $options argument.

Otherwise using the current list of error conditions for load-xquery-module it is unclear what the codes should be in these cases.
Comment 1 Debbie Lockett 2015-05-19 10:10:16 UTC
Regarding the second error case, the "option parameter conventions" (1.5) state clearly what is and isn't considered an error for the $options argument supplied. Rule 6 says:

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the function conversion rules. A dynamic error occurs if the supplied value cannot be converted to the required type, or if the value after conversion is not one of the permitted values for the option in question. **The error codes for this error are defined in the specification of each function.**
Comment 2 O'Neil Delpratt 2015-05-19 15:46:19 UTC
The WG accepted Debbie's proposal to have new dynamic error conditions for fn:load-xquery-module as described in the bug entry. We also agreed to leave it to the editor to create new appropriate error codes for these conditions.
Comment 3 Michael Kay 2015-05-29 10:55:25 UTC
I'd like to "reopen" this (though it hasn't actually been closed) because I think Debbie's suggestions for extra error conditions actually raise a couple of questions about the spec.

(a) fn:transform defines an option saying what version of XSLT needs to be supported.

Specifically:

xslt-version	xs:decimal	The minimum level of the XSLT language that the processor must support. Defaults to the [xsl:]version attribute at the outermost level of the stylesheet.

I think fn:load-xquery-module should have a similar option? 

Proposal: have an xquery-version option:

xquery-version	xs:decimal	The minimum level of the XQuery language that the processor must support. Defaults to the value appearing in the version declaration of the loaded module, or implementation-defined in the absence of such a declaration.

Then add the error condition:

FOQM0006 is raised if no suitable XQuery processor is available.

(b) For load-xquery-module we say:

Nodes that are passed to or from the dynamically loaded module should retain their node identity. However, if this is impossible to achieve (for example, because nodes need to be reconstructed into the representation used by a different software product) then the tree containing a node may be copied, causing a loss of node identity.

which is not quite the same as what we say for fn:transform:

Where nodes are passed to the transformation, for example as the value of the context item or of a stylesheet parameter, they should if possible retain their node identity, their base URI, and their relationships to all other nodes in the containing tree (including ancestors and siblings). If this is not possible, for example because the only way of passing nodes to the chosen XSLT implementation is by serializing and re-parsing, then a node may be passed in the form of a deep copy, which may lose information about the ancestors and siblings of the node, and its relationships to other nodes passed across the interface.

(also, it's a note in one case and a rule in the other).

I suggest unifying these to avoid any unintended differences:

Where nodes are passed to (X), for example as the value of (Y), they should if possible retain their node identity, their base URI, and their relationships to all other nodes in the containing tree (including ancestors and siblings). If this is not possible, for example because the only way of passing nodes to the chosen (XSLT|XQuery) implementation is by serializing and re-parsing, then a node may be passed in the form of a deep copy, which may lose information about the identity of the node, about its ancestors and sibling, and about its relationships to other nodes passed across the interface.
Comment 4 Michael Kay 2015-06-02 20:21:24 UTC
The changes were accepted and have been applied.