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

Thanks Alex for looking into this.
But Iam afraid, what you pointed out is not what Iam looking for.
If I have understood your example correctly, note that
S1, s2 and s3 are attributes under root node Set. As per
Your snippet I see all of them at same level.
Pl correct me if my understanding is wrong.

So in the enumerated type if I select Set, user should be presented
With s1,s2 and s3, if I select Bag, h1, h2 attributes should be
presented

Thanks
Swayam.

-----Original Message-----
From: Alexander Veit [mailto:list@nezwerg.de] 
Sent: Sunday, March 11, 2007 1:55 AM
To: Swayam Vemuri -X (swvemuri - WIPRO at Cisco)
Subject: Re: Selection of enumerated simpleType should offer
sub-attributes based on selection

Swayam Vemuri -X (swvemuri - WIPRO at Cisco) wrote:
> 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.

Do you mean something like

  <xs:complexType name="tBase">
  </xs:complexType>

  <xs:complexType name=tBaseWithSetAttributes>
   <xs:complexContent>
    <xs:extension base="tBase">
     <xs:attribute name="type"
      type="tns:HibernateCollectionElements" fixed="Set"/>
     <xs:attribute name="s1" type="xs:string"/>
     <xs:attribute name="s2" type="xs:string"/>
     <xs:attribute name="s3" type="xs:string"/>
    </xs:extension>
   </xs:complexContent>
  </xs:complexType>

  <xs:complexType name=tBaseWithBagAttributes>
   <xs:complexContent>
    <xs:extension base="tBase">
     <xs:attribute name="type"
      type="tns:HibernateCollectionElements" fixed="Bag"/>
     <xs:attribute name="h1" type="xs:string"/>
     <xs:attribute name="h2" type="xs:string"/>
    </xs:extension>
   </xs:complexContent>
  </xs:complexType>

  ...

-- 
Regards,
Alex


P.S.: I've posted this message to the list, but it seems it didn't come 
through...

Received on Sunday, 11 March 2007 02:16:04 UTC