Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6246922

SchemaValidation ErrorMessages in JAXP 1.3 from xerces are not clear

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 1.3.0
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.6
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
      Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      when i validate a xml file with a schema using JAXP1.3, I get the following errorMessage:

      org.xml.sax.SAXParseException:
                 http://www.w3.org/TR/xml-schema-1#cvc-complex-type.3.2.2?link&x

      instead if I use Xerces propraitory API, then I get a very meaningfull message:

      org.xml.sax.SAXParseException:
                 cvc-complex-type.3.2.2: Attribute 'x' is not allowed to appear in element 'link'.

      on some research i found that, when JAXP1.3 is used, it is not able find Resource Bundle, and thus it composed error message by separating message format arguments
      by '#'

      This is a bug in JAXP 1.3 implementation in xerces bundled with jdk1.5
      i tried in both 1.5.0 and 1.5.0_1

      without proper error messages it is difficut to trace what the exception is talking about...

      Sun Team, plz fix it .............

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      add any invalid attribute to a valid xml and try to perform schema validation.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      exception messages should be clear : for example
         org.xml.sax.SAXParseException:
                 cvc-complex-type.3.2.2: Attribute 'x' is not allowed to appear in element 'link'.
      ACTUAL -
      org.xml.sax.SAXParseException:
                 http://www.w3.org/TR/xml-schema-1#cvc-complex-type.3.2.2?link&x


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      use xerces proprietory api. then we get proper error messages.
      ###@###.### 2005-03-28 21:42:31 GMT

        Attachments

          Activity

            People

            Assignee:
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Reporter:
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: