
What I'm trying to get is an element that looks like this
Code: Select all
<Weight unit="lbs">12.5</Weight>
with the following schema...
Code: Select all
<element name="Weight">
<complexType mixed="true">
<attribute name="unit" use="required">
<simpleType>
<restriction base="xs:string">
<enumeration value="lbs"/>
<enumeration value="kgs"/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
And that works fine and all except I would like to define a type (xs:decimal) to the <Weight> element so users of my schema cannot put in strings. However it appears to not be valid to set a type when I have mixed="true", so what am I to do?