This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Matching on of many string literal values using XPath
- From: TSchutzerWeissmann at uk dot imshealth dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 13 Sep 2002 15:01:07 +0100
- Subject: RE: [xsl] Matching on of many string literal values using XPath
- Reply-to: xsl-list at lists dot mulberrytech dot com
> > you could make a variable that concatenates all the different
> > values you'd like to test for and use contains() to do the
> > test.
[...]
> I could but that will not behave exactly like I would like for every
> possible input. I can get the exact results I desire with a pair of
> for-each loops and a variable containing a node set, but I was hoping
> for something "clean". It looks like nearly the exact same
> question was
> asked here:
>
>http://www.biglist.com/cgi-bin/wilma/wilma_hiliter/xsl-
>list/200006/msg00561.html
The two cases aren't the same - if I've understood, you want an exact
match, and Steve was searching for terms within the entire text content
of a node, and there you really do need contains(), which means for-
eaches as well, because contains evaluates node-sets in string context, ie,
the string value of the first node of the set.
Whereas, if you want an exact match you can just do this
match="foo[.=$terms/term]"
and that will match if foo's value is the same as any of the term nodes
in $terms.
it might work
---
Tom
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list