Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8162598

XSLTC transformer swallows empty namespace declaration which is needed to undeclare default namespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • xml
    • None
    • b130

        Consider the following xsl:

        ---------------------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"/>
                                       </root>
                        </xsl:template>
                        <xsl:template name="transform">
                        <test xmlns=""/>
                        </xsl:template>
        </xsl:stylesheet>
        ---------------------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>

              clanger Christoph Langer
              clanger Christoph Langer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: