File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

XML schema question

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic