xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From david_mars...@us.ibm.com
Subject Re: contains()
Date Thu, 10 Jan 2002 15:49:02 GMT

Cory asks about
  <xsl:template select="item[contains($var,  ./cat/@name)">
>If the var is set to 'abc xxx' it should return item1 only. If the var
>is set to 'abc xyz' it should find item1, item2, and item3. However,
>it doesn't find any, because its only matching on the first <cat>
>within an item. If I change the order of the <cat> elements it
>does work.

[Aside: some list members may not see this because they have
overly-zealous mail filters that discard anything containing 'xxx'.]

>A) Is this a bug?

No, because the function takes two strings as arguments, so it will
stringify ./cat/@name and get the first such value (see XPath 4.2).
There is no implied iteration over the node-set, so you'll have to
either set up explicit iteration or a large or-expression.
.................David Marston

View raw message