This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem to compare a value with a set of tag content



> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]