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 6338 - [FO] fn:string-length() ambiguous sentence
Summary: [FO] fn:string-length() ambiguous sentence
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: 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: 2008-12-31 17:23 UTC by Michael Kay
Modified: 2009-01-28 20:39 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2008-12-31 17:23:20 UTC
Section 7.4.4 contains the sentence (braces inserted to indicate the intended reading)

{If no argument is supplied or if the argument is the context item} and the context item is undefined an error is raised: [err:XPDY0002]XP.

which can easily be misread as:

If no argument is supplied or {if the argument is the context item and the context item is undefined} an error is raised: [err:XPDY0002]XP.

The same problem also occurs for fn:normalize-space().

Possible alternative wording:

If no argument is supplied or the argument is the context item then an error is raised if the context item is undefined: [err:XPDY0002]XP.

However, the same error is raised if the argument is any other expression whose value depends on the context item, for example @att; the error here is nothing specific to this function. So I would suggest changing the paragraph in which the sentence occurs to:

If no argument is supplied, $arg defaults to the string value of the context item (that is, the value of the expression string(.)). If the context item is undefined this will result in an error: [err:XPDY0002]XP.
Comment 1 Michael Kay 2009-01-02 14:57:58 UTC
The same problem was reported for fn:normalize-space in bug #4974, and fixed by means of erratum E14. A similar solution was adopted to the one proposed here.
Comment 2 Michael Kay 2009-01-28 20:39:38 UTC
Erratum E34 has been drafted to clarify the offending sentence. The bug is accordingly being marked fixed and closed.