mixing mininclusive and enumeration in xml



I have an xml element whose range of value is (intrinsically) 1-20 so I can use: minInclusive=1 and maxInclusive=20 to restrict the intrinsic set.



<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="20"/>
</xs:restriction>


However, I also want to be able to set an extrinsic value of -4 which has the specific meaning: «Unknown»


Is this possible? That is: 1-20 & -4 (not -4-20).


I thought I might be able to get away with adding enumeration value= -4 but that doesn't seem to work.



<xs:restriction base="xs:integer">
<xs:enumeration value="-4"/>
<xs:minInclusive value="1"/>
<xs:maxInclusive value="20"/>
</xs:restriction>

No comments:

Post a Comment