Re: [xsl] Directory listing, as xml file

Subject: Re: [xsl] Directory listing, as xml file
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Mon, 02 Jun 2008 11:35:41 +0100
Andrew Welch wrote:
Some code is here:

http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200607/msg00568.html

xmlns:File="java:java.io.File" xmlns:xs="http://www.w3.org/2001/XMLSchema";

<xsl:param name='dir' select='"null"' as="xs:string"/>

Needed type to help java 1.6 sort out 'string' from 'uri' parameter type



  <xsl:template match="/" name='root'>
    <xsl:if test="$dir= 'null'">
      <xsl:message terminate='yes'>
        No input directory, quitting
      </xsl:message>
    </xsl:if>


<xsl:variable name="dir" select="File:new($dir)" /> <xsl:variable name="files" select="File:list($dir)"/>

    <xsl:for-each select="$files">
      <xsl:if test="contains(.,'.xml')">
      <xsl:message>
        file is <xsl:value-of select="."/>
      </xsl:message>
    </xsl:if>
    </xsl:for-each>

</xsl:template>


Thanks Andrew




regards

--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

Current Thread