<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:scripts="http://www.bluedust.com/fsml"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    >

<xsl:output method="html" encoding="utf-8" media-type="text/plain"/>
     <xsl:template match="fsml">

<script language="javascript">
function showhide(id) {
   if (document.getElementById){
      obj = document.getElementById(id);
      if (obj.style.display == "none"){
         obj.style.display = "";
      } else {
         obj.style.display = "none";
      }
   }
}
</script>

        <xsl:apply-templates select="filesys"/>
     </xsl:template>

<xsl:template match="dir">
<table border="0" width="100%">
   <tr><td width="32"><img src="/icons/folder.gif"/></td><td><a href="#" onclick="showhide('div{translate(@name,' ','_')}'); return false;"><xsl:value-of select="@name"/></a></td></tr>
   <tr><td/><td>
      <div id="div{translate(@name,' !','__')}" style="display:none;">
         <xsl:apply-templates select="dir"/>
         <xsl:apply-templates select="file"/>
         <xsl:apply-templates select="link"/>
      </div>
    </td></tr>
</table>
</xsl:template>

<xsl:template match="file">
<table border="0" width="100%">
<tr><td width="32"><img src="/icons/generic.gif"/></td><td align="left"><xsl:value-of select="@name"/></td>
<td valign="top"><xsl:apply-templates/></td>
<td align="right"><xsl:value-of select="@size"/></td>
</tr>
</table>
</xsl:template>

<xsl:template match="link">
<table border="0">
<tr><td width="32"><img src="/icons/link.gif"/></td><td align="left"><xsl:value-of select="@name"/></td>
<td valign="top"><xsl:apply-templates/></td>
<td></td>
</tr>
</table>
</xsl:template>

</xsl:stylesheet>

