I have the following class hierarchy / type hierarchy:
A
a
b
c
The xml schema is something like this:
<complexType name="A">
<sequence>
<element minOccurs="1" name="parent" type="A"/>
</sequence>
</complexType>
<complexType name="a">
<complexContent>
<extension base="A"/>
</complexContent>
</complexType>
<complexType name="b">
<complexContent>
<extension base="A"/>
</complexContent>
</complexType>
<complexType name="c">
<complexContent>
<extension base="A"/>
</complexContent>
</complexType>
A is the superclass of a, b and c. A defines a parent that is a pointer
to an instance of one of its subclasses. But there are some
restrictions of what parent can be in the different subclasses. The
following rules apply:
a.parent can be instance of a
b.parent can be instance of a or b
c.parent can be instance of a or b
Is there a way I can capture this in XML Schema? Is there a way to use
enumeration on types?
Thanks
Kim