12.8 Parameters

<?xml version="1.0" encoding="utf-8" ?>  
<xsl:stylesheet version="1.0"  
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
>  
  <xsl:template match="/">  
     <xsl:call-template name="visit" >  
        <xsl:with-param name="depth" select="0" />  
     </xsl:call-template>  
  </xsl:template>  
 
  <xsl:template name="visit">  
     <xsl:param name="depth" />  
 
     <xsl:value-of select="concat( name(), ':', $depth, ' ')" />  
     <xsl:variable name="i" select="$depth + 1" />  
 
     <xsl:for-each select="child::*">  
       <xsl:call-template name="visit" >  
           <xsl:with-param name="depth" select="$i" />  
       </xsl:call-template>  
     </xsl:for-each>  
 
  </xsl:template>  
 
</xsl:stylesheet>  
<?xml version="1.0"  
      encoding="utf-8" ?>  
<a> <b> <c/> </b> <d/> <e/> </a>  
<?xml version="1.0" encoding="UTF-8"?>  
:0 a:1 b:2 c:3 d:2 e:2