<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6306</bug_id>
          
          <creation_ts>2008-12-12 15:41:40 +0000</creation_ts>
          <short_desc>[FO] idref() invocation of normalize-space() is wrong</short_desc>
          <delta_ts>2008-12-16 23:15:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22749</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-12-12 15:41:40 +0000</bug_when>
    <thetext>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), &apos; &apos;) 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)), &apos; &apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22775</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-12-16 23:15:27 +0000</bug_when>
    <thetext>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&apos;s master of the 1.1/2.1 spec. Note that the erratum supersedes E3.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>