using mixed="true" and trying to set a type
Posted: Fri Feb 13, 2009 10:33 pm
I may be going at this the entirely wrong way, so don't shy away from pointing out glaring mistakes
What I'm trying to get is an element that looks like this
with the following schema...
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?
What I'm trying to get is an element that looks like this
Code: Select all
<Weight unit="lbs">12.5</Weight>
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>