<?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>28238</bug_id>
          
          <creation_ts>2015-03-19 09:51:13 +0000</creation_ts>
          <short_desc>[XDM 3.1] Lists that mix IDREF with non-IDREF values</short_desc>
          <delta_ts>2015-03-25 10:19:32 +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>Data Model 3.1</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Norman Walsh">ndw</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>118676</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-03-19 09:51:13 +0000</bug_when>
    <thetext>Sorry about this one: it&apos;s a tiny insignificant edge case...

XDM states in section 6.3.4:

&lt;quote&gt;
is-idrefs
If any of the atomic values in the typed-value of the attribute is of type xs:IDREF or xs:IDREFS, or a type derived from one of those types, the is-idrefs property is true, otherwise it is false.

Note:

This rule means that a type constructed by list with an item type of xs:IDREF (or a type derived from xs:IDREF) has the is-idrefs property, whether or not the list type is named xs:IDREFS or is derived from xs:IDREFS. Because union types are allowed, it also means that an element or attribute with the is-idrefs property can contain atomic values of type xs:IDREF alongside values of other types.
&lt;/quote&gt;

I have written a test case fn-idref-33 which uses a type

list( union( NCName[pattern=&apos;[A-Z]&apos;], IDREF ) )

and creates two elements with this type:

&lt;e&gt;Q&lt;/e&gt;

and

&lt;e&gt;Q some-id&lt;/e&gt;

I believe that with the rules as written, idref(&apos;Q&apos;) matches the second element but not the first. This is because the first element does not have the is-idrefs property, because the typed value does not include an atomic value of type IDREF.

Clearly this behaviour is, to put it politely, counter-intuitive.

(For the benefit of historians, the text was introduced as a result of bug #3032)

I think there are two things we can do.

(A) we can retain this interpretation of the spec, and explain it more clearly in the (cited) Note. (The Note is anyway incorrect in talking about is-idrefs as a property of a type, when it is actually a property of a node).

(B) we can change the spec so that all elements whose type permits the type value to contain an atomic value of type IDREF have the is-idrefs property, whether or not the actual instance contains such a value. It would be an incompatible change, but it&apos;s very unlikely anyone would notice; we could claim that this is what we meant all along.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118905</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-03-24 16:03:25 +0000</bug_when>
    <thetext>We decided to go for (A) - no technical change to the spec, but explain the situation more clearly in notes in XDM and F+O.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118928</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-03-25 10:19:32 +0000</bug_when>
    <thetext>The non-normative Notes in F+O regarding this edge case have been clarified.

Revised text for the Note in XDM has been proposed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>