[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: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 1 Sep 2006 13:11:22 +0100
regex getting filename
> So a further tokenization is necessary to remove query parameters and
> fragment identifier.

this is true in general (as well as the observation that there may be no
file at all) but I've found editing base-uri like this to be very useful
in xslt2 stylesheets where it would be very hard to do the xslt1-thing
of passing in the filename as a parameter as the stylesheet is iterating
over a collection() so you don't really have any external control over
which input documents are being processed. Although I do know in those
cases that the uri will be file: without any # or / part.

I'd probably do replace(base-uri(/),'.*/','') to remove the path
component rather than tokenize and last() but it probably doesn't make
much difference really. You could add |[\?#].* to the regex to also
remove query and fragment identifiers if they were a possibility.


David

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-2011 All Rights Reserved.