xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Cohen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (XALANC-739) Unexpected output when using identity transformation
Date Thu, 27 Dec 2012 21:12:13 GMT
Jeff Cohen created XALANC-739:
---------------------------------

             Summary: Unexpected output when using identity transformation
                 Key: XALANC-739
                 URL: https://issues.apache.org/jira/browse/XALANC-739
             Project: XalanC
          Issue Type: Bug
          Components: XalanC
    Affects Versions: 1.11
         Environment: Linux
            Reporter: Jeff Cohen
            Assignee: Steven J. Hathaway


Input XSL
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common">
  <xsl:output method="xml" indent="yes" />
  <!-- ********************************************* -->
  <xsl:template match="/body/div//a" mode="test-mode">
    <xsl:copy>
      <xsl:attribute name="new_attr">1</xsl:attribute>
      <xsl:apply-templates select="@*|node()" mode="test-mode" />
    </xsl:copy>
  </xsl:template>
  <xsl:template match="node()|@*" mode="test-mode">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" mode="test-mode" />
    </xsl:copy>
  </xsl:template>
  <!-- ********************************************* -->
  <xsl:template match="/">
    <xsl:copy>
      <xsl:apply-templates select="." mode="test-mode" />
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Input XML
<body>
    <div>
      <div>
        <a href="abc.pdf" >Testing</a>
      </div>
    </div>
  </body>

Expected Output:
<?xml version="1.0"?>
<body>
    <div>
      <div>
        <a new_attr="1" href="abc.pdf">Testing</a>
      </div>
    </div>
  </body>

Actual Output:
<?xml version="1.0" encoding="UTF-8"?>
<body>
    <div>
      <div>
        <a href="abc.pdf">Testing</a>
      </div>
    </div>
  </body>

I receive the expected results when I run this transformation through xsltproc on Linux.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org
For additional commands, e-mail: dev-help@xalan.apache.org


Mime
View raw message