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

Element Declarations Consistent and valid type substitutions via xsi:type

From: Post, Dr. Ulrich <Ulrich.Post@softwareag.com>
Date: Wed, 16 Mar 2005 22:14:50 +0100
Message-ID: <76EEB38C72AE1D4EA2FE2753766EB51447E9F0@DAEMSG03.eur.ad.sag>
To: <www-xml-schema-comments@w3.org>

Hi

recently I found the proposed extension to the "Element Declarations
Consistent"
constraint as described in 
 
http://www.w3.org/XML/Group/2002/07/xmlschema-1.1-current-reqs-list.html
#ElementDeclarationsConsistent


When wondering about the motivation for these constraints, I ended up
with
the following intention:

  The type of a child element E which may occur as a child of a parent
element
  PE shall not depend on ist position in the content [model].

If this is correct, then how about the following scenario:

<element name="PE" type="CT">

<complexType name="CT"/>

<complexType name="CT1"/>
  <extension base="CT">
    <sequence>
      <element name="E" type="E-type-1"/>
    </sequence>
    <attribute name="A" type="A-type-1"/>
  </extension>
<complexType>

<complexType name="CT2"/>
  <extension base="CT">
    <sequence>
      <element name="E" type="E-type-2"/>
    </sequence>
    <attribute name="A" type="A-type-2"/>
  </extension>
<complexType>
  
Then, when looking at the following two documents

<PE xsi:type="CT1" A="..."><E>...</E></PE>
<PE xsi:type="CT2" A="..."><E>...</E></PE>

Now E is once validated vs. "E-type-1", once vs "E-type-2",
similarly for A.

I wonder whether there should be a similar constraint to
"Element Declarations Consistent" demanding that
"E-type-1" is the same named type as "E-type-2",
the same for "A-type-1" and "A-type-2".
  
Best regards
Uli
Received on Wednesday, 16 March 2005 21:15:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 23 October 2007 06:13:36 GMT