W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2002

Re: Multiple Type definition

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 21 May 2002 17:52:39 +0100
Message-ID: <16179615743.20020521175239@jenitennison.com>
To: Jingkun Hu <hujingkun@yahoo.com>
CC: xmlschema-dev@w3c.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:02 UTC