|
-
February 20th, 2001, 05:25 PM
#1
XML Schema
I have an xml file that I want to do a one-many type relationship in. Is this possible using schemas? I have a simplified version of the problem below. An animal has either 0 or 4 legs. If it has four legs then it will have a <LegMap> that always has the same four leg elements. I tried playing around with <xsd:all> but wasn't quite able to get it to work. Is what I want to do possible?
<Animal>Horse
<LegMap>
<Leg>Front Left</Leg>
<Leg>Front Right</Leg>
<Leg>Rear Left</Leg>
<Leg>Rear Right</Leg>
</LegMap>
</Animal>
<Animal>Cow
<LegMap>
<Leg>Front Left</Leg>
<Leg>Front Right</Leg>
<Leg>Rear Left</Leg>
<Leg>Rear Right</Leg>
</LegMap>
</Animal>
<Animal>Snail
</Animal>
-
February 28th, 2001, 11:11 AM
#2
Re: XML Schema
Hi,
try using th following in the schema for the leg
element name="leg" minOccurs=0 maxOccurs="unbounded"
I have eleminated the angular brackets.
make sure this element comes under element legMap
-Chidu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|