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 4974 - [FO] Clarify error condition in fn:normalize-space()
Summary: [FO] Clarify error condition in fn:normalize-space()
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 XP
: P2 minor
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: 2007-08-21 20:49 UTC by Don Chamberlin
Modified: 2007-11-16 09:34 UTC (History)
0 users

See Also:


Attachments

Description Don Chamberlin 2007-08-21 20:49:48 UTC
This is an editorial suggestion. The description of fn:normalize-space() contains the following sentence:

"If no argument is supplied or if the argument is the context item and the context item is undefined an error is raised."

This could be misinterpreted as "If no argument is supplied, or (...), then an error is raised."

A less ambiguous way to state this rule is as follows:
"If the implicit or explicit argument is the context item, and the context item is undefined, an error is raised."

Regards,
Don Chamberlin
Comment 1 Michael Kay 2007-09-25 14:55:10 UTC
The proposed revision isn't quite right, because the implicit argument is not "." but "string(.)". (I'm not really sure why: but that's the way it is, and they aren't quite the same.)

I don't think we need to say that "if the argument is the context item and the context item is undefined then XPDY0002 is raised". This means you have written normalize-space(.), and in this case normalize-space() gets no say in the matter because the error has already occurred while evaluating the argument, ".", under XPath section 3.1.4. So (avoiding the temptation to make more extensive changes) I think we should change the relevant paragraph to read:

<new>
If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined then an error is raised: [err:XPDY0002]XP.
</new>
Comment 2 Michael Kay 2007-09-25 16:00:40 UTC
The WG agreed on 25 Sep 2007 to make the change proposed in comment #1
Comment 3 Michael Kay 2007-11-15 22:10:17 UTC
The erratum will be published as E14