W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

RE: does this valid in xml schema?

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Thu, 23 Aug 2001 09:32:00 -0400
To: "'liying'" <lsui@cs.ucsd.edu>, <xmlschema-dev@w3.org>
Message-ID: <012501c12bd8$2957ba30$1ab0153f@xmls>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:23 GMT