9.2 Starting with an Identity Transformation

Unless you are translating to or from an XML format that is completely different from the DirXML format, you will want to start your style sheet with templates that implement the identity transformation. These templates allow the events in the document that you don’t specifically try to intercept and change to pass through without any modifications.

The following two templates together implement the identity transformation:

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