Re: [xsl] Getting text from string

Subject: Re: [xsl] Getting text from string
From: "Heiko Niemann" <kontakt@xxxxxxxxxxxxxxxx>
Date: Wed, 2 Nov 2011 00:22:27 +0100
> 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"
> xsl:variable name="dirPath" select="substring-before(@path,'/')"/
> xsl:variable name="dirPath" select="substring-after(@path,'/')"/
This regex also might work for you:


Heiko Niemann

Current Thread