Selection of enumerated simpleType should offer sub-attributes based on selection

Hi,

 

I have a requirement wherein, I have a enumerated
simpleType/complexType, like as shown below

 

<xs:simpleType name="HibernateCollectionElements">

            <xs:restriction base="xs:string">

                  <xs:enumeration value="Set"/>

                  <xs:enumeration value="Bag"/>

                  <xs:enumeration value="List"/>

            </xs:restriction>

</xs:simpleType>

 

Now based on the user selection(that is Set or Bag or List) ,

I need to present a set of attributes. This set of attributes is
different for different values given in enumerated value set.

 

That is if user selects Set, then he will be given attributes s1, s2 and
s3.

If user selects Bag, then he will be given attributes h1, h2  and so on.

 

Can any one please let me know how to have above logic in a xsd, with an
example.

I did search couple of books, but in vain.

 

Thanks and regards,

Swayam

Received on Saturday, 10 March 2007 09:38:50 UTC