Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2149

Namespace Undeclaration in XML input document is not handled correctly.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.7
    • 2.7
    • DTM
    • None
    • Windows 2000
    • fp2

    Description

      Namespace Undeclaration for XML 1.1 sytlesheet is not supported in Xalan. However, a XML 1.1 input document can undeclare namespace prefix. Xalan should handle the Namespace undeclaration in XML 1.1 input documents correctly.

      For example,
      XML 1.1 input document:
      ------------------------------------
      <?xml version="1.1"?>
      <ns:ele xmlns:ns="uri" xmlns:p1="prefix1">
      <ele1 xmlns:ns="">
      </ele1>
      <ele2/>
      <ele3 xmlns:ns="" xmlns:p2="prefix2"/>
      </ns:ele>
      -----------------------------------

      Sytlesheet:
      -----------------------------------
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml" version="1.1" indent="yes" />

      <xsl:template match="/">
      <out>
      <v1>
      <xsl:value-of select="count(//ele1/namespace::)"/>
      </v1>
      <v2>
      <xsl:value-of select="count(//ele2/namespace::)"/>
      </v2>
      <v3>
      <xsl:value-of select="count(//ele3/namespace::)"/>
      </v3>
      </out>
      </xsl:template>
      </xsl:stylesheet>
      ----------------------------------------

      Current output:
      ----------------------------------------
      <?xml version="1.1" encoding="UTF-8"?>
      <out>
      <v1>3</v1>
      <v2>3</v2>
      <v3>4</v3>
      </out>
      ----------------------------------------

      Correct output:
      ----------------------------------------
      <?xml version="1.1" encoding="UTF-8"?>
      <out>
      <v1>2</v1>
      <v2>3</v2>
      <v3>3</v3>
      </out>
      ---------------------------------------

      Attachments

        Activity

          People

            ytalwar@ca.ibm.com Yash Talwar
            ytalwar@ca.ibm.com Yash Talwar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: