Bug 6338 - [FO] fn:string-length() ambiguous sentence
: [FO] fn:string-length() ambiguous sentence
Status: CLOSED FIXED
Product: XPath / XQuery / XSLT
Functions and Operators 1.0
: Recommendation
: PC Windows NT
: P2 normal
: ---
Assigned To: Michael Kay
: Mailing list for public feedback on specs from XSL and XML Query WGs
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-12-31 17:23 UTC by Michael Kay
Modified: 2009-01-28 20:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.


  翻译: