How can I restrict an attribute to not allow a particular value?
For instance, I have an <xs:key/> on an Id attribute of an element, but some yahoo has gone and thrown a magic number in there so now I cannot allow 3, but 1, 2, and 5 are perfectly acceptable.
Have you tried having a look at the restriction tag link text, the code below, it should give you a tag called Id which only allows integers that doesn't start with a 3
<xs:key name="Id">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[^3]\d*"/>
</xs:restriction>
</xs:simpleType>
</xs:key>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With