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

Report warning when the maxLength limit is exceeded in an enumeration

    XMLWordPrintableJSON

Details

    Description

      If the maxLength limit is exceeded in an enumeration, Xerces engine does not report this error.
      If I use Saxon engine I get en warning message:
      "Enumeration value "REQUESTED_CHARGE" is not a valid instance of the type: it contravenes the maxLength facet"
      You can find below a sample schema. I tested on the xml-schema-1.1-dev branch.

      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:simpleType name="PaymentStatus">
              <xsd:restriction base="xsd:string">
                  <xsd:maxLength value="15"/>
                  <xsd:enumeration value="AWAIT_PAY_INFO"/>
                  <xsd:enumeration value="AWAIT_AUTH"/>
                  <xsd:enumeration value="REQUESTED_AUTH"/>
                  <xsd:enumeration value="REQUESTED_CHARGE"/>
                  <xsd:enumeration value="PAID"/>
              </xsd:restriction>
          </xsd:simpleType> 
      </xsd:schema>
      

      Attachments

        Activity

          People

            mukul_gandhi Mukul Gandhi
            octavian.nadolu Octavian Nadolu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: