Re: Multiple Type definition

Hi Jingkun,

> My question is if I can assign multiple types to a sequence of
> elements with same element name. The following is a block of an
> example:
>
> <xsd:complexType name="procedure_report">
>   <xsd:sequence>
>     <xsd:element name="item" type="item_1" minOccurs="0"/>
>     <xsd:element name="item" type="item_2"/>
>     <xsd:element name="item" type="item_3" maxOccurs="unbounded"/>
>     <xsd:element name="item" type="item_4" minOccurs="0"/>
>   </xsd:sequence>
> </xsd:complexType>

No, you can't. This violates the "Element Declarations Consistent"
constraint which states that, within a particular content model, all
elements of the same name must have the same type.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 22 May 2002 02:51:45 UTC