[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Frank Marent wrote:
A backslash cannot be a literal part of a URI, it is not allowed. It must be escaped for that purpose as %5C. Because a URI may well have additional information after the 'filename', namely the query part and the fragment part, I recommend using the regular expression that is provided as a convenience in the RFC2396 paper. It puts the path in $5::
You can use the tokenize function above for splitting $5. Not however that that a path separator not necessarily be a slash, it depends on the scheme part ($2) what is and what is not allowed in the path expression.
Cheers,
Re: [xsl] Get Document File name
Subject: Re: [xsl] Get Document File name From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Mon, 23 Oct 2006 08:35:32 +0200 |
Frank Marent wrote:
hi phil
Is there a way to get the file name of the document you are processing? If I
use Document-uri() it returns the whole file path.
i'm using
tokenize(document-uri(/), '/')[last()]
or '\' if working with backslashes.
A backslash cannot be a literal part of a URI, it is not allowed. It must be escaped for that purpose as %5C. Because a URI may well have additional information after the 'filename', namely the query part and the fragment part, I recommend using the regular expression that is provided as a convenience in the RFC2396 paper. It puts the path in $5::
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? 12 3 4 5 6 7 8 9
You can use the tokenize function above for splitting $5. Not however that that a path separator not necessarily be a slash, it depends on the scheme part ($2) what is and what is not allowed in the path expression.
Cheers,
-- Abel Braaksma http://www.nuntia.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Get Document File name, Frank Marent | Thread | RE: [xsl] Get Document File name, Michael Kay |
[xsl] Table Proportional Column Wid, siarom egrub | Date | RE: [xsl] getting type information , Michael Kay |
Month |