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

Subject: [xsl] another beginner question - strip directory info from variable
From: "Dave Lang emaildavelang@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Oct 2018 01:48:50 -0000
Hi again everyone - back with another beginner question.

I'm working in Oxygen and am using Saxon.

I'm searching through a bunch of xml files in search of jpg names. I'm creating variables as follows:

<xsl:variable name="allxml" select="collection('..//xml/?select=*.xml;recurse=yes')"/>
<xsl:variable name="jpgs" select="$allxml//element/@n"/>


$jpgs looks like:

dir1/jpg001.jpg dir1/jpg002.jpg dir1/jpg003.jpg

etc.

I want to strip away the dir info, but am having a hard time. I've tried using tokenize and substring-after but both return similar errors.

"A sequence of more than one item is not allowed as the first argument of fn:tokenize() ("dir1/jpg001.jpg", "dir1/jpg002.jpg")."

Because I don't know what I'm doing, I don't know what I'm doing wrong. :)

Can anyone help me figure out how to solve this problem?

thanks!
dave

Current Thread