Re: [xsl] XSLT collection function to get filenames

Subject: Re: [xsl] XSLT collection function to get filenames
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Sun, 16 Mar 2008 14:57:09 +0100
Arno H.P. Reuser wrote:

If the following:

    <x:for-each select="collection('?select=*.xml')">
        <br /><x:value-of select="//h1" />
    </x:for-each>

will print the value of 'h1' tags of each document with extension .xml in the current directory, then how can I get it to print/capture the filename itself of each file?

You can get the URI with <URL:http://www.w3.org/TR/xpath-functions/#func-document-uri>
<xsl:value-of select="document-uri(/)"/>
to get the file name you will need to take the string after the last slash.


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread