pjpark
February 20th, 2001, 04:25 PM
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>
<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>