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

Parsing XML 1.1 files with SAX gives unexpected results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u67
    • xml

      FULL PRODUCT VERSION :
      java version "1.7.0_67"
      Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X 10.9.5
      13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64


      A DESCRIPTION OF THE PROBLEM :
      When parsing files that declare themselves as XML Version 1.1, raw XML gets passed into org.xml.sax.helpers.DefaultHandler.

      This looks awfully similar to OpenJDK Issue JDK-8012541: https://bugs.openjdk.java.net/browse/JDK-8012541 but this time for SAX instead of DOM.

      This is fixed in 1.8.0_20 but can be reproduced on 1.6.0 (tried u51 and upwards).

      Source code that exposes this bug is available at https://github.com/criege/java-bugs/tree/master/src/bugs/xml

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Look at https://github.com/criege/java-bugs/tree/master/src/bugs/xml

      Running this with "-ea" makes the assert statement fail. If you look at the output note the following line before the assertion fails:

      -- snip --
      FI/19000101/99991231
      91/tDescrip/99991231
      -- /snip --

      It looks like the raw XML is passed into the DefaultHandler.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Assertion does not fail
      ACTUAL -
      Assertion fails

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      https://github.com/criege/java-bugs/tree/master/src/bugs/xml
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Setting the XML version in the input file to "1.0" resolves this.

            aefimov Aleksej Efimov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: