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

Re: function for getting filename

Subject: Re: function for getting filename
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 01 Sep 2006 12:01:18 +0100
Re:  function for getting filename
>>>>> "andrew" == andrew welch <andrew.j.welch@xxxxxxxxx> writes:

    andrew> On 9/1/06, Frank Marent <frank.marent@xxxxxxxxxxx> wrote:
    >> i'm struggling again and again over this point:
    >> 
    >> is there a function in xslt that gives me the clean filename of
    >> the processed xml file? like
    >> 
    >> 'myfile.xml' 'test.xml' 'anyfilename.xml'
    >> 
    >> i do *not* need the document-uri. only the filename of the
    >> current processed xml file.

    andrew> In xslt 2.0 I use:

    andrew> tokenize(base-uri(.), '/')[last()]

That's not sound - . might not be the document node - if it's an
element with an xml:base attribute in scope, then you may get
something very spurious indeed.

Using document-uri in your expression looks sounder. 

If the OP is invoking a transformation from the command line, then he
can pass in the file name as a parameter. That is reliable.

-- 
Colin Adams
Preston Lancashire

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.