United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6594813 XML Parsing differences
6594813 : XML Parsing differences

Details
Type:
Bug
Submit Date:
2007-08-20
Status:
Closed
Updated Date:
2012-04-25
Project Name:
JDK
Resolved Date:
2007-12-17
Component:
xml
OS:
windows
Sub-Component:
org.xml.sax
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.0
Fixed Versions:
1.3.0

Related Reports
Backport:

Sub Tasks

Description
During test of NY with ADS (Adobe Document Services), a problem is found in the XML parser. Adobe passed XML data (with name space) and they expected parser result
with name space. Adobe created sample problem for it. (Please look at attachment. Just
need to compile and run without parameter)

Expected result:
<?xml version="1.0" encoding="UTF-8"?><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><xfa:data><testxml>Test Content</testxml></xfa:data></xfa:datasets>

With Sun JDK(s) 1.4.xx, 1.5.0_11 and 1.6.xx, the expected output is obtained.

But with Sun JDK 1.5.0_12, different (unexpected)output is returned:
<?xml version="1.0" encoding="UTF-8"?><xfa:datasets><xfa:data><testxml>Test Cont
ent</testxml></xfa:data></xfa:datasets>

No name space is returned. The Paraser result has namespace in the other JDK versions other than JDK 1.5 U12. What has changed in this version to produce this result? The changelog does not document this.

                                    

Comments
EVALUATION

Remove filter of "xmlns:foo" attributes to output the correct result when input parser does not enable namespaces and preserve backward compatibility with earlier version of JAXP 1.3. In addition, by removing this filter, we restore forward compatibility with JAXP 1.4. Note that if the output of a transform is SAX or DOM, namespaces must still be enabled in the input parser or an exception will be thrown.
                                     
2007-09-04
EVALUATION

I'm not exactly sure what CR may have caused this change. However, technically speaking, the application should enable namespaces in the SAXParserFactory created in,

XMLElemContentReplacer.parse()

Namely, it should call factory.setNamespaceAware(true) as this is required by the XSLT processor. I believe this should solve the problem.
                                     
2007-08-20



Hardware and Software, Engineered to Work Together