W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2015

Correct semantics of XML Schema extension with respect to the content models

From: <timothymarc@freenet.de>
Date: Fri, 09 Oct 2015 09:42:12 +0200
To: xmlschema-dev@w3.org
Message-Id: <3bcf4cda3334ee54b003079c699e9907@email.freenet.de>
Hi all,
 
I am struggling with the exact semantics of extension regardingthe derivation of the content model. Please see the following two types:
 
       xs:complexTypename="CT10Sequence">
              xs:sequence>
                     xs:elementmaxOccurs="3"name="e1"type="tns:CT1"/>
              xs:sequence>
       xs:complexType>
 
       xs:complexTypename="CT11Sequence">
              xs:complexContent>
                     xs:extensionbase="tns:CT10Sequence">
                           xs:choice>
                                  xs:elementmaxOccurs="3"name="e2"type="tns:CT1"/>
                           xs:choice>
                     xs:extension>
              xs:complexContent>
       xs:complexType>
 
The question that bothers me for quite a long time now is: whichof the following two “virtual” types corresponds to the semantics ofCT11Sequence regarding the content model?
 
1.      The content model of CT11Sequence incorporatesthe content model of CT10Sequence
       xs:complexTypename="CT11Sequence_Derived1">
              xs:choice>
                     xs:elementmaxOccurs="3"name="e2"type="tns:CT1"/>
                            xs:sequence>
                                   xs:elementmaxOccurs="3"name="e1"type="tns:CT1"/>
                            xs:sequence>
              xs:choice>
       xs:complexType>
 
2.      The content model of CT10Sequence remains onfirst position and incorporates the content model of CTSequence11
       xs:complexTypename="CT11Sequence_Derived2">
                     xs:sequence>
                     xs:elementmaxOccurs="3"name="e1"type="tns:CT1"/>
>                              
xs:elementmaxOccurs="3"name="e2"type="tns:CT1"/>
                     xs:choice>
xs:sequence>
       xs:complexType>
 
The difference is substantial, for in the first alternative exclusivelyeither of the elements can appear, whereas in the second alternative element e1and e1 must occur but in the exact order.
 
I am grateful for any hint. According to my validator, the second alternative should be the correct interpretation, but I would like to get other expert opinions and maybe also a hint to the XSD spec where this semantics is described.

 
Best regards,
Timothy
   Normal  0          false  false  false    EN-GB  X-NONE  X-NONE  table.MsoNormalTable	



---
Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! http://email.freenet.de/basic/Informationen
Received on Friday, 9 October 2015 14:09:37 UTC

This archive was generated by hypermail 2.3.1 : Friday, 9 October 2015 14:09:38 UTC