Union like mechanism for complex data types?

Andrey Brozhko

Usenet Archive
Joined
Dec 9, 2004
Messages
3
Reaction score
0
Hi

The situation:

XML document can be either

<?xml version="1.0" encoding="UTF-8"?>
<test>
<item>1</item>
<item>2</item>
</test>

or

<?xml version="1.0" encoding="UTF-8"?>
<test>testKeyWord</test>

So I have two types defined:

<xs:complexType name="IntegerArray">
<xs:sequence>
<xs:element name="item" type="types:IntegerType"/>
</xs:sequence>
</xs:complexType>

and the second type:

<xs:simpleType name="KeyWord">
<xs:restriction base="xs:string">
<xs:enumeration value="testKeyWord"/>
<xs:enumeration value="testKeyWord2"/>
</xs:restriction>
</xs:simpleType>

Is there any way I can 'merge' lexical spaces of these types together (similar to what union does for simple types)? If not, what's the correct way to describe the content of my xml document?

Thanks
Andrey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top