[Bug 5223] [XQuery] Casting rules in 3.5.2 General Comparisons (editorial)

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5223

           Summary: [XQuery] Casting rules in 3.5.2 General Comparisons
                    (editorial)
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: hrennau@yahoo.de
         QAContact: public-qt-comments@w3.org


The casting rules for xs:untypedAtomic as described in items a-c depend on
whether the situation that "the other operand is an instance of T" is given or
not when the other operand's dynamic type is a subtype of T. 

Consider these example:
ex 1:    <a>1</a> = xs:Name("A1")
ex 2:    <a>A1 </a> = xs:Name("A1")

If the right operand is "an instance of xs:string", ex1 and ex2 yield false.
Otherwise, ex1 yields a cast error, and ex2 yields true.

Testing 3 major processors, I found both behaviours!

I believe "is an instance of T" is meant in accordance with the instance
operator, that is, to include all subtypes of T. However, the term is nowhere
defined, and, interestingly, not used when explaining the semantics of the
instance operator. Therefore perhaps it would be worthwhile to add a note to
b), making it clear that the situation "other operand is an instance of a
subtype of xs:string" is included.

With kind regards,
Hans-Juergen Rennau

Received on Tuesday, 23 October 2007 20:59:41 UTC