Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Union like mechanism for complex data types?

Reply
Thread Tools

Union like mechanism for complex data types?

 
 
Andrey Brozhko
Guest
Posts: n/a
 
      12-21-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what's easiest way to compare a Float & BigDecimal (i.e. like aequals mechanism) Greg Hauptmann Ruby 7 11-10-2008 04:46 PM
want to sort tables inside a complex mechanism, what can be the approach? vj Java 0 12-28-2006 01:20 PM
union in struct without union name Peter Dunker C Programming 2 04-26-2004 07:23 PM
map XML union to C union (and vice-versa) Matt Garman XML 1 04-25-2004 12:40 AM
For expert on complex loops (reposted) - complex looping problem news.amnet.net.au Java 1 04-13-2004 07:10 AM



Advertisments