Re: [xsl] another beginner question - strip directory info from variable

Subject: Re: [xsl] another beginner question - strip directory info from variable
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Oct 2018 16:51:42 -0000
On 14.10.2018 18:33, Dave Lang emaildavelang@xxxxxxxxx wrote:

I have jpg names that are preceded by "dirinfo/" as well as "blahblah="

I could change my search to ignore the "blahblah=" results but I'd rather include / process those as well.

Is it possible to use two separators with tokenize?


The second argument to the tokenize function https://www.w3.org/TR/xpath-functions/#func-tokenize is a regular expression pattern so you can use several separators there with the right regular expression syntax e.g.

("foo/img1.jpg", "bar=img2.jpg")!tokenize(., "[/=]")[last()]

gives a sequence with two strings

"img1.jpg", "img2.jpg"

Current Thread