Multiple Type definition

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: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> 

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

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?

Jingkun

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Received on Tuesday, 21 May 2002 05:29:05 UTC