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 28238 - [XDM 3.1] Lists that mix IDREF with non-IDREF values
Summary: [XDM 3.1] Lists that mix IDREF with non-IDREF values
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Data Model 3.1 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Norman Walsh
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-19 09:51 UTC by Michael Kay
Modified: 2015-03-25 10:19 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2015-03-19 09:51:13 UTC
Sorry about this one: it's a tiny insignificant edge case...

XDM states in section 6.3.4:

<quote>
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.
</quote>

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

list( union( NCName[pattern='[A-Z]'], IDREF ) )

and creates two elements with this type:

<e>Q</e>

and

<e>Q some-id</e>

I believe that with the rules as written, idref('Q') 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's very unlikely anyone would notice; we could claim that this is what we meant all along.
Comment 1 Michael Kay 2015-03-24 16:03:25 UTC
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.
Comment 2 Michael Kay 2015-03-25 10:19:32 UTC
The non-normative Notes in F+O regarding this edge case have been clarified.

Revised text for the Note in XDM has been proposed.