René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

XSL: // and match="/"

The XML File:
<a>one
  <b>two
    <c>three
       <d>four
       </d>
    </c>
  </b>
  <e>five
    <f>six
      <g>seven
        <h>eight
        </h>
      </g>
    </f> 
  </e>
</a>
The XSL File:
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version="1.0">  
 
<xsl:template match="/">  
<h1><xsl:value-of select="//d"/></h1>  
<h2><xsl:value-of select="//f"/></h2>  
</xsl:template>  
</xsl:stylesheet>  
The Output (whitespaces manually modified):
<?xml version="1.0" encoding="UTF-8"?>
<h1>four</h1>
<h2>six seven eight</h2>