Although the XML file being described by the XSD Schema may contain any unicode characters in general, there are some fields where only ASCII is allowed. (As these strings are going to be passed to another system which only accepts ASCII.)
Is there a way to specify that in XSD?
A regexp with all possible ASCII characters would be a possibility I suppose, but I feel there must be a better way.
You can try that :
<xs:simpleType name="basicLatin">
<xs:restriction base="xs:string">
<xs:pattern value="\p{IsBasicLatin}*"/>
</xs:restriction>
</xs:simpleType>
Unfortunately, for your requirement there isn't a way to restrict without using patterns.
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