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

<!-- $Id: bench_xslt_complex,v 1.1.1.1 2003/09/09 12:43:23 mrodrigu Exp $ -->

<xsl:output method="xml" />

<xsl:template match="node() | @*">
  <xsl:copy>
    <xsl:apply-templates select="@* | node()" />
  </xsl:copy>
</xsl:template>

<xsl:template match="process[@action='delete']"></xsl:template>
<xsl:template match="process[@action='erase']"><xsl:apply-templates/></xsl:template>

<xsl:template match="process[@action='change_tag']">
  <new_tag>
   <xsl:copy-of select="@*" />
    <xsl:apply-templates/>
  </new_tag>
</xsl:template>

<xsl:template match="process[@action='prefix']">
  <xsl:element name="{name(.)}" >
   <xsl:copy-of select="@*" />
    <prefix>prefixed </prefix>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>

<xsl:template match="process[@action='duplicate']">
  <xsl:copy>
    <xsl:apply-templates select="@* | node()" />
  </xsl:copy>
  <xsl:copy>
    <xsl:apply-templates select="@* | node()" />
  </xsl:copy>
</xsl:template>

<!--
<xsl:template match="process[@action='add_att']">
  <xsl:element name="{name(.)}" >
   <xsl:attribute name="new_att">foo</xsl:attribute>
   <xsl:copy-of select="@*" />
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
-->

<xsl:template match='process[@action="add_att"]'>
  <process new_att='foo'>
  <xsl:copy-of select='@*'/>
    <xsl:apply-templates/>
  </process>
</xsl:template>


</xsl:stylesheet>
