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

Multiple Type definition

From: Jingkun Hu <hujingkun@yahoo.com>
Date: Mon, 20 May 2002 13:46:50 -0400 (EDT)
Message-ID: <20020520174634.78814.qmail@web14603.mail.yahoo.com>
To: xmlschema-dev@w3c.org
Your quick reply will be greatly appreciated.

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:element name="item" type="item_1"
			<xsd:element name="item" type="item_2"/>
			<xsd:element name="item" type="item_3"
			<xsd:element name="item" type="item_4"

here, item_1, .., item_4 can be simpleType or

The trick here is that not all the elements - 'item'
are mandatory, e.g., if the first item is missing, the
validation engine doesn't know which type to use for
validating the present item. 

Anyway, my observation is that XMLSpy and XSV don't
complain this Schema definition. But it validates the
second item (here, the first item is not provided)
against the item_1's definition. When I use Microsoft
parser, it complains the Schema definition by saying
"mutiple definition for a single element".

I'm wondering if multiple type definition for a single
element is allowed in the current XML Schema
specification. If yes, which tools support it?


Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
Received on Tuesday, 21 May 2002 05:29:05 UTC

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