xsl-list
[Top] [All Lists]

Re: [xsl] Getting text from string

2011-11-03 07:05:03
Thanks!

Is it also possible to use the tokenize to retrieve the following?

Input: @path = "dir1/dir2/dir3/dir4/filename"

Output: @path = "dir1/dir2/dir3/dir4"

Bascially pickup everything up to the last "/"?

Would the combination of the substring plus ? obtain this?



On Tue, Nov 1, 2011 at 1:23 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
On 1 November 2011 17:18, Stan Mikita <markev8(_at_)gmail(_dot_)com> wrote:
Hi,

I have a directory path value and i want to grab the text "filename"
to the right of the last "/". I've tried using the below without any
luck. Is there a reverse search where you can tell it to search from
the right up to the first occurence of a "/"? Value can be many
directories deep.

path = "dir1/dir2/dir3/dir4/filename"

select="tokenize(@path, '/')[last()]"


--
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--