Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] function for getting filename

From: David Carlisle <davidc@--------->
To:
Date: 9/1/2006 12:12:00 PM
> 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent