To all you XML experts, let's say I have the following in an XML doc:
<heading units="TRUE">55 </heading>
I would like to develop a schema that will both provide for an
enumeration for the attribute and restrict the input to some range of
values. In the example above, I want the enumeration to be restricted
to TRUE and MAG. And, I want the valid values the text to be 0 through
359. I seem to be able to get one or the other but not both. This is
what I have currently:
<xs:element name="heading">
<xs:complexType >
<xs:simpleConte nt>
<xs:extension base="xs:unsign edShort">
<xs:attribute name="units" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="TRUE"/>
<xs:enumerati on value="MAG"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleConten t>
</xs:complexType>
</xs:element>
It is my understanding that facets can only be applied to simple types
and that once you add an attribute to an element, it becomes a complex
type. So, how do you work around this?
Thanks for your help.