RE: does this valid in xml schema?

Hello,

No, this is not valid.  It is not possible to have two "items" elements in
the content model of "order" that have different types.  They can have
different annotations, default values, etc. but they must have the same
type.  This is described in Schema Component Constraint: Element
Declarations Consistent in section 3.8.6 of the Structures rec.


Priscilla

-----------------------------------------------------------
Priscilla Walmsley                   priscilla@walmsley.com
Architect, Vitria Technology          http://www.vitria.com
Author, Definitive XML Schema  (Prentice Hall, Dec. 2001)
-----------------------------------------------------------

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of liying
> Sent: Friday, July 13, 2001 8:31 AM
> To: xmlschema-dev@w3.org
> Subject: does this valid in xml schema?
>
>
> I have a question
> I don't know whether or not this is a valid xml schema
>
> thanks for help me
>
> <xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>
>                     <xsd:element     name="shipOrder" type="order"/>
>
>                     <xsd:complexType name="order">
>                      <choice>
>                       <sequence>
>                            <xsd:element   name="shipTo"
> type="shipAddress"/>
>                            <xsd:element   name="items"
> type="cdItems"/>
>                       </sequence>
>                       <sequence>
>                             <xsd:element   name="mailfrom"
> type="string"/>
>                            <xsd:element   name="items"
> type="string"/>
>                       </sequence>
>                      </choice>
>                     </xsd:complexType>
>
>          ......definition of shipAddress and cdItems
>
>                     </xsd:schema>
>
>
> In short, my question is can those two item element appears
> as this way
> under a big choice but with different definition
>
>
>

Received on Thursday, 23 August 2001 09:30:55 UTC