jaxp
  1. jaxp
  2. JAXP-58

XML processing instruction parsing error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      58

      Description

      A piece of code that we have that used to work in Java 1.5/JAXP 1.3 is broken
      in Java 1.6/JAXP 1.4. Here is a boiled-down version of the java code that
      demonstrates the problem. The output from the java file should be "foo", but
      comes out as "". The XML in question starts with a processing instruction and
      no prolog, but I think the parser gets confused and treats it as the prolog but
      throws away the data.. not really sure.

      import java.io.*;
      import org.w3c.dom.*;
      import org.xml.sax.*;
      import com.sun.org.apache.xerces.internal.parsers.*;

      class test {
      public static void main( String[] args ) throws Exception

      { ByteArrayInputStream bais = new ByteArrayInputStream( "<?xmltarget foo? ><test></test>".getBytes() ); DOMParser p = new DOMParser(); p.parse( new InputSource( bais ) ); System.out.println( ( (ProcessingInstruction)p.getDocument().getFirstChild () ).getData() ); }

      }

        Activity

        Hide
        Joe Wang added a comment -

        Tested in jdk5u11 and 18. The issue appears in jdk6 and current jaxp workspace.

        Show
        Joe Wang added a comment - Tested in jdk5u11 and 18. The issue appears in jdk6 and current jaxp workspace.
        Hide
        Joe Wang added a comment -

        Fixed in jaxp 1.4 repository. We will arrange for integration into jdk6 update
        release and jdk7. Meanwhile, you may place the jaxp-ri.jar in the endorsed dir
        to override existing jdks. See also http://bugs.sun.com/bugdatabase/view_bug.do?
        bug_id=6849942

        Show
        Joe Wang added a comment - Fixed in jaxp 1.4 repository. We will arrange for integration into jdk6 update release and jdk7. Meanwhile, you may place the jaxp-ri.jar in the endorsed dir to override existing jdks. See also http://bugs.sun.com/bugdatabase/view_bug.do? bug_id=6849942
        Hide
        kats added a comment -

        Excellent, thanks for the quick fix!

        Show
        kats added a comment - Excellent, thanks for the quick fix!
        Hide
        Joe Wang added a comment -

        It's a pleasure. Hope it's helpful to your project

        Show
        Joe Wang added a comment - It's a pleasure. Hope it's helpful to your project

          People

          • Assignee:
            jaxp-issues
            Reporter:
            kats
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: