JDK-6594813 : XML Parsing differences
  • Type: Bug
  • Component: xml
  • Sub-Component: org.xml.sax
  • Affected Version: 1.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2007-08-20
  • Updated: 2012-04-25
  • Resolved: 2007-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.0 1.3Fixed
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.
04-09-2007

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.
20-08-2007