Re: [xsl] Getting text from string

Subject: Re: [xsl] Getting text from string
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 3 Nov 2011 12:21:53 +0000
On 3 November 2011 12:04, Stan Mikita <markev8@xxxxxxxxx> wrote:
> 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"

Yep, tokenize(@path, '/') will return a sequence of strings, 'dir1',
'dir'2 etc, everything except the string used to split them.

You can then rejoin them using string-join($tokens[position() ne last()], '/')

Andrew Welch

Current Thread