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

schema validation incorrectly treating single character outside of BMP as two characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • None
    • Windows 7, Oracle Java JRE 1.7

    Description

      When validating the instance document http://home.arcor.de/martin.honnen/xml/oneCharInstance1.xml against the schema http://home.arcor.de/martin.honnen/xml/oneCharSchema1.xsd Xerces reports the following validation error(s):

      "[Error] oneCharInstance1.xml:3:25: cvc-length-valid: Value '?' with length = '2'
      is not facet-valid with respect to length '1' for type 'one-char'.
      [Error] oneCharInstance1.xml:3:25: cvc-type.3.1.3: The value '?' of element 'test' is not valid."

      The "test" element however contains a single character (<test>𐌀</test>), albeit one which is not inside the BMP. In terms of the XML specification http://www.w3.org/TR/xml/#dt-character and the schema data type specification http://www.w3.org/TR/xmlschema-2/#string there is no difference between characters in the BMP and outside of it, each one counts as a single character.

      So the sample XML is valid against the sample schema and Xerces should not report any error.

      Other validating parsers like Saxon 9.4 EE and XSV (http://www.w3.org/2001/03/webdata/xsv?docAddrs=http%3A%2F%2Fhome.arcor.de%2Fmartin.honnen%2Fxml%2FoneCharInstance1.xml+http%3A%2F%2Fhome.arcor.de%2Fmartin.honnen%2Fxml%2FoneCharSchema1.xsd&warnings=on&keepGoing=on&style=xsl#) don't report any validation error for the samples named above.

      Attachments

        Activity

          People

            Unassigned Unassigned
            martin.honnen Martin Honnen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: