Re: [xsl] how to create variable by comparing two variables using [not]

Subject: Re: [xsl] how to create variable by comparing two variables using [not]
From: "Dave Lang emaildavelang@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Oct 2018 20:16:10 -0000
I think I did a poor job of explaining what I'm trying to do.

I have two lists of jpg names: $jpg_few and $jpg_many.

I know that there are jpg names in $jpg_many that are not in jpg_few, but that's okay, I'm not interested in them.

I'm trying to find what jpg names are in $jpg_few that are NOT in $jpg_many.

I thought I had tokenized $jpg_few and $jpg_many when I created them.

When I try to create a new variable by using a "not" expression with $jpg_few and $jpg_many, I get an error message re: "A sequence of more than one item is not allowed as the first argument of fn:tokenize()".

I tried doing string-join to $jpg_few and $jpg_many before putting them in the expression but that didn't work either.

Here's the expression I'm trying to use to create a variable that shows which jpg names from $jpg_few are NOT in $jpg_many.

<xsl:variable name="jpgs_in_xml_not_directories" select="($jpg_few)[not(. = $jpg_many)]"/>

I think the problem is that I'm trying to do something with $jpg_few and $jpg_many that I can't do because they're strings or something, but this is where I get in over my head. Frustratingly, I used exactly the same syntax with three different (but also tokenized) variables earlier in the script and it worked fine.

Any assistance appreciated.
thx
dave

Current Thread