W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2004

subst group example in Primer?

From: Burak Emir <Burak.Emir@epfl.ch>
Date: Mon, 29 Nov 2004 17:30:01 +0100
Message-ID: <41AB4E89.4040604@epfl.ch>
To: xmlschema-dev@w3.org

Hello all,

The XML Schema Part 0, Section 4.6 "Substitution groups" reads
Declaring Elements Substitutable for comment

<element name="shipComment" type="string"
<element name="customerComment" type="string"

When these declarations are added to the international purchase order 
schema, |shipComment| and |customerComment| can be substituted for 
|comment| in the instance document, for example:

Snippet of ipo.xml <http://www.w3.org/TR/xmlschema-0/#ipo.xml> with 
Substituted Elements

  <item partNum="833-AA">
    <productName>Lapis necklace</productName>
      Use gold wrap if possible
      Want this for the holidays!


But if you check ipo.xsd elsewhere, you find:

 <complexType name="Items">
      <element name="item" minOccurs="0" maxOccurs="unbounded">
            <element name="productName" type="string"/>
            <element name="quantity">
                <restriction base="positiveInteger">
                  <maxExclusive value="100"/>
            <element name="USPrice"    type="decimal"/>
            <element ref="ipo:comment" minOccurs="0"/> <!-- CHECK THIS ONE OUT -->
            <element name="shipDate"   type="date" minOccurs="0"/>
          <attribute name="partNum" type="ipo:SKU" use="required"/>

Why would it be allowed to include a customerComment AND a shipComment ?!? My thinking goes, there should be up to one.
Have I overlooked something?


Burak Emir

Received on Monday, 29 November 2004 16:30:05 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:06 UTC