This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Problem to compare a value with a set of tag content
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 30 May 2002 10:52:26 +0100
- Subject: Re: [xsl] Problem to compare a value with a set of tag content
- References: <3CF5CD51.9030302@netcourrier.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> the real one is
>
> <liste>
> <compte>
> <pdf>1</pdf>
> <pdf>4</pdf>
> ...
> </compte>
> <annonce id ="1">
> bla bla
> </annonce>
> <annonce id ="2">
> bla bla
> </annonce>
> <annonce id ="3">
> bla bla
> </annonce>
> </liste>
> that why i needed a nested structure.
It doesm't look very nested to me.
Not
<annonce id ="3">
<annonce id ="3.2">
<annonce id ="33.2.1">
.
.
.
> i tried five solutions
But as I said, you don't want this <xsl:for-each select="../compte/pdf">
because otherwise you only set the variable within the scope of the
inner for-each, but your original message indicated that you wanted to
know this value while working on the annonce element.
You just want
<xsl:for-each select="liste/annonce">
<xsl:variable name="en-pdf" select="@id=/liste/compte/pdf"/>
some code ...
<xsl:if test="$en-pdf">
... some code just on teh case that id is in the compte/pdf list
</xsl:if
</xsl:for-each>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list