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 3653 - Exception conditions for fn.string
Summary: Exception conditions for fn.string
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Ashok Malhotra
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-04 16:48 UTC by Oliver Hallam
Modified: 2006-09-22 10:20 UTC (History)
0 users

See Also:


Attachments

Description Oliver Hallam 2006-09-04 16:48:19 UTC
In section 2.3 of the specification:
fn:string() as xs:string
fn:string($arg as item()?) as xs:string

The spec says:
If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.

However it also says:
The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.

This should read "if the context item is not an item" in place of "if the context item is not a node", since the context item can still be a valid parameter for fn:string while not being a node (eg if the context item is a sequence of xs:strings).
Comment 1 Michael Kay 2006-09-04 17:29:01 UTC
>This should read "if the context item is not an item"

No: the context item, if it exists at all, is always an item.

The phrase "if the context item is not a node [err:XPTY0004]XP." should simply be deleted.
Comment 2 Andrew Eisenberg 2006-09-15 17:31:06 UTC
The XSL and XML Query WGs considered this issue at their Sept. 12 meeting.

The WGs agree with the resolution that Michael Kay proposed above:

"The phrase "if the context item is not a node [err:XPTY0004]XP." should simply
be deleted."

Please close this bug report if you agree with our resolution.
Comment 3 Tim Mills 2006-09-22 10:20:12 UTC
Thanks.