JDK-8162598 : XSLTC transformer swallows empty namespace declaration which is needed to undeclare default namespace
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-07-27
  • Updated: 2017-11-29
  • Resolved: 2016-07-31
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.
8u152Fixed 9 b130Fixed
Related Reports
Relates :  
Consider the following xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
                <xsl:template match="/">
                               <root xmlns="ns1">
                                               <xsl:call-template name="transform"/>
                <xsl:template name="transform">
                <test xmlns=""/>
---------------------End of XSL---------------------

Transform an XML snippet like this (just a dummy):
<?xml version="1.0" encoding="UTF-8"?><aaa></aaa>

The result with the current XSLTC is:
<?xml version="1.0" encoding="UTF-8"?><root xmlns="ns1"><test/></root>

This would not undeclare the default namespace ���ns1���, coming from the element ���root���, in the element ���test���.
It should be:
<?xml version="1.0" encoding="UTF-8"?><root xmlns="ns1"><test xmlns=""/></root>