Union like mechanism for complex data types?

A

Andrey Brozhko

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
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top