Re: [xsl] XSL, SQL, and trees (again)

Subject: Re: [xsl] XSL, SQL, and trees (again)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Jul 2006 12:57:33 +0100
<xsl:stylesheet version="2.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="directories">
    <directories>
      <xsl:apply-templates select="item[not(contains(path,'.'))]"/>
    </directories>
  </xsl:template>

  <xsl:template match="item">
    <directory name="{name}">
      <xsl:apply-templates select="../item[matches(path,concat('^',current()/path,'.[^\.]$'))]"/>
    </directory>
  </xsl:template>

</xsl:stylesheet>


$ saxon8 table1.xml table1.xsl \!indent=yes
<?xml version="1.0" encoding="UTF-8"?>
<directories>
   <directory name="About"/>
   <directory name="Services">
      <directory name="Environmental"/>
      <directory name="Landscaping"/>
   </directory>
</directories>

Current Thread