xsl-list
[Top] [All Lists]

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

2018-10-14 11:51:46
On 14.10.2018 18:33, Dave Lang emaildavelang(_at_)gmail(_dot_)com 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"
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>