Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1743

XSD simpleType enumeration values must satisfy base type assertions, by only analyzing an XSD schema

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            mukul_gandhi Mukul Gandhi
            mukul_gandhi Mukul Gandhi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: