-
Bug
-
Resolution: Fixed
-
P3
-
7
-
h1146
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185496 | 7 | Joe Wang | P3 | Closed | Fixed | m05 |
JDK-2182545 | 6u18 | Joe Wang | P3 | Resolved | Fixed | b02 |
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() );
}
}
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() );
}
}
- backported by
-
JDK-2182545 Jaxp Issue 58: XML processing instruction parsing error
-
- Resolved
-
-
JDK-2185496 Jaxp Issue 58: XML processing instruction parsing error
-
- Closed
-