[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Directory listing, as xml file

Subject: Re: Directory listing, as xml file
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Mon, 02 Jun 2008 11:35:41 +0100
Re:  Directory listing
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.