|
Rank: Newbie
Joined: 6/25/2015 Posts: 2 Location: Newmarket, Suffolk, UK
|
Can someone tell me how to construct an XSD schema for an element that can be a positive float or the word "Auto"?
Thanks - Rowan
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
This should do the thing:
Code: <xs:simpleType> <xs:union> <xs:simpleType> <xs:restriction base="xs:float"> <xs:minExclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Auto"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType>
|
|
Rank: Newbie
Joined: 6/25/2015 Posts: 2 Location: Newmarket, Suffolk, UK
|
Brilliant. This has worked fine. I had tried to use Union in one of my previous attempts, but must have got it wrong somehow.
Thanks - Rowan
|
|
guest |