W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2009

[Bug 7913] New: Strange result from definition of governing element declaration

From: <bugzilla@wiggum.w3.org>
Date: Tue, 13 Oct 2009 21:16:33 +0000
To: www-xml-schema-comments@w3.org
Message-ID: <bug-7913-703@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=7913

           Summary: Strange result from definition of governing element
                    declaration
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: David_E3@VERIFONE.com
        ReportedBy: kbraun@obj-sys.com
         QAContact: www-xml-schema-comments@w3.org
                CC: cmsmcq@blackmesatech.com


The definition of governing element declaration seems to produce an odd effect.
 According to the rules, when there is no processor-stipulated decl, and no
context-determined decl, but there is a locally declared type, the governing
element declaration is absent.

Consider this example:
<xs:element name="elem1" type="xs:int" fixed="10"/>
<xs:element name="elem2" type="xs:int" fixed="10"/>

<xs:element name="root" type="OddBall"/>

<xs:complexType name="OddBall">
   <xs:sequence>
      <xs:element name="elem1" type="xs:int"/>
      <xs:any/>
      <xs:any/>
   </xs:sequence>
</xs:complexType>

And consider this instance:
<root>
   <elem1>5</elem1>
   <elem1>9</elem1>
   <elem2>10</elem2>
</root>

The second elem1 is attributed to a strict wildcard; it does not have a
context-determined declaration.  It does have a locally declared type, the
local elem1 declaration.  The result is that elem1 does not have a governing
declaration, and it not required to meet the fixed value constraint.  However,
elem2 is in a fairly parallel situation, but it will have a governing element
declaration and elem2's fixed value will apply.

Perhaps I have missed something, but this seems quite odd to me.  I can't quite
make out why 3.3 in the definition of governing element declaration is there. 
Also, it looks like this is different behavior from XSD 1.0.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 13 October 2009 21:16:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:17 GMT