Subject: RE: using contains() on multiple elements of the same name
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 18 Oct 2006 00:27:16 +0100
|
contains() takes a single string as its first argument, not a set of
strings.
Write
a[b[contains(.,'Bunch')]]
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Boge.Brett [mailto:Brett.Boge@xxxxxxx]
> Sent: 18 October 2006 00:00
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: using contains() on multiple elements of the same name
>
> I'm having a problem, I'm trying to make a selection like so...
>
> XSL:
>
> This works-
>
> <xsl:for-each select="a[contains(b,'Lovely')]">
> ...
> </xsl:for-each>
>
> This doesn't-
>
> <xsl:for-each select="a[contains(b,'Bunch')]">
> ...
> </xsl:for-each>
>
> XML:
>
> <a>
> <b id="something"> <item> Lovely </item> </b>
> <b id="something lese"> <item> Bunch </item> </b>
> <b> <item> Of coconuts </item> </b>
> </a>
>
> How do I make this work like I want it to (so that it will
> match Lovely, Bunch, Of, and coconuts)?
>
>
> Have a good day,
>
> Brett Boge
|