Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

XML schema question

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi, all:

I have two complex types:

<xs:complexType name="type1">
<xs:all>
<xs:element name="A"/>
<xs:element name="B"/>
</xs:all>
</xs:complexType>

<xs:complexType name="type2">
<xs:all>
<xs:element name="C"/>
<xs:element name="D"/>
</xs:all>
</xs:complexType>

I want another type which is the union of type1 and type2. Of course I can do this:


<xs:complexType name="type3">
<xs:all>
<xs:element name="A"/>
<xs:element name="B"/>
<xs:element name="C"/>
<xs:element name="D"/>
</xs:all>
</xs:complexType>


But I wanna use type 1 and type2 to define type3. I don't wanna retype all these elements (there may be many elements). How to do it? union can only be used for simpleType?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello "Al Bundy",

First of all, please take a minute for reading our naming policy and adjust your display name accordingly -- no obviously fake names, please.

Second, please don't cross-post. I'm closing this thread; the discussion should be continued in the XML forum instead.

Thanks.
 
    Bookmark Topic Watch Topic
  • New Topic