xsl-list
[Top] [All Lists]

Re: [xsl] XSLT collection function to get filenames

2008-03-16 07:09:42
Exactly what I was looking for! Thanks!

Sincerely,

Arno H.P. Reuser
CEO, Reuser's Information Services

----
http://www.reuser.biz
a(_at_)reuser(_dot_)biz



Martin Honnen wrote:
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.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--