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 6306 - [FO] idref() invocation of normalize-space() is wrong
Summary: [FO] idref() invocation of normalize-space() is wrong
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-12 15:41 UTC by Michael Kay
Modified: 2008-12-16 23:15 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2008-12-12 15:41:40 UTC
The specification of fn:idref() (in 15.5.3) says:

A node $N has an IDREF value equal to V if both of the following conditions are true:

    * The is-idrefs property (See Section 5.6 is-idrefs AccessorDM.)of $N is true
    * The sequence fn:tokenize(fn:normalize-space($N), ' ') contains a string that is equal to V ...

Now if $N is a node that has acquired the is-idrefs property by virtue of having the schema type xs:IDREFS, then the call to normalize-space() will implicitly atomize $N to produce a sequence of atomic values of type xs:IDREF; and if there is more than one such atomic value, the call will fail with a type error, because its signature expects an argument of type xs:string? (that is, it does not accept a sequence of more than one string).

I think that what is intended is 

    fn:tokenize(fn:normalize-space(fn:string($N)), ' ')
Comment 1 Michael Kay 2008-12-16 23:15:27 UTC
The proposed change was accepted by the WG on 16 Dec 2008. Erratum E29 has been drafted to the 1.0/2.0 spec, and the change has been applied to the editor's master of the 1.1/2.1 spec. Note that the erratum supersedes E3.