Sorry if this is a stupid question but have to ask to know if this is possible So this is XSD
<xs:simpleType name="PhoneTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="Fax"/>
<xs:enumeration value="Voice"/>
<xs:enumeration value="Pager"/>
</xs:restriction>
</xs:simpleType>
The relaxation is below
Is this possible in XSD schema validation? If not then we have to do this in custom code validation in java.
Please suggest if this is doable?
With XSD 1.0 the only way to do case-blind matching is along the lines
<xs:restriction base="xs:string">
<xs:pattern value="[Ff][Aa][Xx]|[Vv][Oo][Ii][Cc][Ee]|..."/>
</xs:restriction>
With XSD 1.1 you could use an assertion instead.
But I don't understand your requirement that validation shouldn't fail if the conditions aren't met. (Technically, validation never fails: it reports an element as being either valid or invalid. However, most schema processors don't make it easy to validate a document and then inspect the nodes to see which are valid and which aren't.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.