Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xs:enumeration

 
Blikkies Marais
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a xsd schema, in it I have the following:
<xs:restriction base="xs:string">
<xs:enumeration value="xr_ht_select"/>
<xs:enumeration value="xr_ht_text"/>
<xs:enumeration value="xr_ht_radio"/>
<xs:enumeration value="xr_ht_checkbox"/>
<xs:enumeration value="xr_ht_input"/>
<xs:enumeration value="xr_ht_password"/>
<xs:enumeration value="xr_ht_textarea"/>
<xs:enumeration value="xr_ht_mailto"/>
</xs:restriction>
This means that in the xml file, you have a choice of only the above listed values for the attribute. This also give you a drop down of these values in some xml editors (eg. xml spy).
However, I would like to keep this drop down functionality, but remove the "restriction" of only those values. I.e. do not give a validation error if a values other than the above listed ones are enetered.
Is the another type other than "xs:restriction" with "xs:enumeration"?
Thanks
 
Ashish Pagare
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add <xs:enumeration value=""/> to your enumeration list. This is a round about way to achieve what you want. With this you can specify any value for this element.
Perhaps some one else will have a nicer solution.
[ December 19, 2003: Message edited by: Ashish Pagare ]
 
Blikkies Marais
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick response, but unfortunaly this does not solve my problem.
Adding "<xs:enumeration value=""/>" only allows blank attributes to pass validation. I am looking to be able to type free test into the attribute, but still have the drop down list (that some xml editors offer) of the values listed above.
Any Ideas?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic