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

problem with xsl:copy-of while copying namespace nodes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.7
    • Fix Version/s: None
    • Component/s: Xalan
    • Labels:
      None
    • Environment:
      Xalan-J 2.7.0, JDK 1.5.0_04, Win XP Prof

      Description

      There seems to be some problem with xsl:copy-of while copying namespace nodes..

      Please consider this example.

      Source XML:

      <?xml version="1.0" ?>
      <!-- this is a comment -->
      <?pqr x="do-something" ?>
      <author xmlns:a="xyz" xmlns:b="pqr">
      <person a:age="30"> by <FirstName>Jane</FirstName>
      <LastName>Doe</LastName>,
      </person>
      </author>

      XSLT Stylesheet:

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" indent="yes" />

      <xsl:template match="/author">
      <test>
      <xsl:copy-of select="namespace::*" />
      </test>
      </xsl:template>

      </xsl:stylesheet>

      The right output of transformation should be:

      <?xml version="1.0" encoding="UTF-8"?>
      <test xmlns:a="xyz" xmlns:b="pqr"/>

      But Xalan-J 2.7.0 produces output..

      <?xml version="1.0" encoding="UTF-8"?>
      <test/>

      I think that this is a non-conformance according to XSLT 1.0 spec.

      The relevant section of the spec is:
      Erratum E25 at
      http://www.w3.org/1999/11/REC-xslt-19991116-errata/.

      Regards,
      Mukul

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mukul_gandhi Mukul Gandhi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: