Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > conditional restriction in schema?

Reply
Thread Tools

conditional restriction in schema?

 
 
Andrew L
Guest
Posts: n/a
 
      01-28-2004
Hello all,

I'm new to XML schema design, and I've got a problem which I need some help
with. I have a simple type which describes a list of valid categories. I
also have another type which describes a list of all known subcategories.
However only a subset of the subcategories will be valid and this depends
on the value of the main category.
eg If category is cat1, then the only valid subcategories are scat1, scat2.
How and where can I put in a conditional operator in my schema?

<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="cat1"/>
<xs:enumeration value="cat2"/>
<xs:enumeration value="cat3"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="category">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="scat1"/>
<xs:enumeration value="scat2"/>
<xs:enumeration value="scat3"/>
<xs:enumeration value="scat4"/>
<xs:enumeration value="scat5"/>
</xs:restriction>
</xs:simpleType>

Many thanks for your help

Andrew
 
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
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
GLBP group restriction when using a sup2 and 6500 switch Tristan Cisco 0 03-08-2005 04:12 PM
Internet restriction =?Utf-8?B?R1RheWxvcg==?= Wireless Networking 1 08-07-2004 11:28 PM
Re: Software Restriction Policies Bhargav Shukla MCSE 0 04-01-2004 06:08 PM
Re: Telnet restriction with access-list sPiDEr Cisco 0 06-23-2003 06:39 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57