W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2005

[Bug 2169] R-172: Questions viz. when fields match element with the ur-type

From: <bugzilla@wiggum.w3.org>
Date: Wed, 14 Sep 2005 18:05:40 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1EFbdc-0006ge-Ei@wiggum.w3.org>


           Summary: R-172: Questions viz. when fields match element with the
           Product: XML Schema
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSD Part 1: Structures
        AssignedTo: ht@w3.org
        ReportedBy: sandygao@ca.ibm.com
         QAContact: www-xml-schema-comments@w3.org

Consider the schema: 


        <xsd:element name="root">
                    <xsd:element name="name" maxOccurs="unbounded"/>
            <xsd:key name="nameKey">
                <xsd:selector xpath="./name"/>
                <xsd:field xpath="."/>


Since no type is declared for the local "name" element, by the properties 
tableaus in [1], it must have the ur-type. 

Consider the instance document 

        xsi:schemaLocation="http://tests.com idAnytype.xsd">
        <name>Jack Daniels<name>

        <name>Johnny Walker<name>

        <name>Sam Adams<name>
>From the 3rd point of [2]: 

"3 For each node in the target node set all of the {fields}, with that node as 
the context node, evaluate to either an empty node-set or a node-set with 
exactly one member, which must have a simple type. " 
[3] tells us that the ur-type can behave as a simpleType "according to 

"[Definition:] A distinguished ur-type definition is present in each XML 
Schema, serving as the root of the type definition hierarchy for that schema. 
The ur-type definition, whose name is anyType, has the unique characteristic 
that it can function as a complex or a simple type definition, according to 
This raises two questions: 

Is it valid for a <field> to match an element with the ur-type definition under 
any circumstances? 
If such a match may sometimes be valid (presumably when the element only 
contains textual content): 
If the element contains text, in which value space should the schema-normalized 
value of the field be considered to lie? This will be significant in the case 
of keyref matches, especially in light of the recent discussions concerning the 
incomparability of values from disjoint value spaces. 
I presume that an error should be raised if the instance of the ur-typed 
element actually contains element content? Or should the <field> match simply 
[1]: http://www.w3.org/TR/xmlschema-1/#declare-element 

[2]: http://www.w3.org/TR/xmlschema-1/#section-Identity-constraint-Definition-

[3]: http://www.w3.org/TR/xmlschema-1/#key-urType 


Henry's response:
Received on Wednesday, 14 September 2005 18:06:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:04 UTC