Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.12.2
-
None
Description
Please consider following XSD 1.1 document,
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="color">
<xs:simpleType>
<xs:restriction base="Color">
<xs:enumeration value="a"/>
<xs:enumeration value="b"/>
<xs:enumeration value="c"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:simpleType name="Color">
<xs:restriction base="xs:string">
<xs:assertion test="matches($value, '^(red|green|blue|yellow)$')"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
The above XSD document should be invalid, because simpleType enumeration value(s) don't satisfy base type assertion facet. This invalidity assessment, must be detected while analyzing an XSD schema (i.e, when building the XSD schema component model).
Currently, XercesJ XSD 1.1 validator is not able to do this.