But Roger, why not
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:choice>
<xs:element name="ISBN" type="xs:string"/>
<xs:element name="Edition" type="xs:string"/>
</xs:choice>
</xs:sequence>
Greetings, Frank
Hi Folks, This XML Schema choice: <xs:choice> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="ISBN" type="xs:string"/> </xs:sequence> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Edition" type="xs:string"/> </xs:sequence> </xs:choice> results in this error: Title and Title violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles. The branches of a choice cannot start with the same element name. Suppose, for whatever reason, you need the choices to start with the Title element, what to do? Here's a hack: Create a base complexType and for each branch of the choice create a subtype: <xs:complexType name="Publication" abstract="true" /> <xs:complexType name="BookPublication"> <xs:complexContent> <xs:extension base="Publication"> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="ISBN" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="MagazinePublication"> <xs:complexContent> <xs:extension base="Publication"> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Edition" type="xs:string"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> Declare an element with the base type, Publication, as its type: <xs:element name="Item" type="Publication"/> In an XML instance document, if you want the <Item> element to hold book data (Title, ISBN), do this: <Item xsi:type="BookPublication"> <Title>...</Title> <ISBN>...</ISBN> </Item> If you want the <Item> element to hold magazine data (Title, Edition), do this: <Item xsi:type="MagazinePublication"> <Title>...</Title> <Edition>...</Edition> </Item> TaDa! /Roger _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@lists.xml.org subscribe: xml-dev-subscribe@lists.xml.org List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php