Connecting Tech Pros Worldwide Forums | Help | Site Map

Defining 2 xml elements with same name but different types.

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 27 '08
Hi i would like to define 2 xml elements with same name but different types in a choice tag

<xs:choice>
<xs:element name = "B" type="TypeB1"/>
<xs:element name = "B" type="TyoeB2"/>
</xs:choice>

I am not able to do the above and xml beans complains.

Any thoughts on how to go about doing it ?

Thanks.

~Adil.

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#2: Aug 28 '08

re: Defining 2 xml elements with same name but different types.


the only thing I can think of is, whether both types are valid
Quote:

Originally Posted by www.w3schools.com

type - Optional. Specifies either the name of a built-in data type, or the name of a simpleType or complexType element

Reply