[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Re: Problem to compare a value with a set of tag content
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 30 May 2002 10:52:26 +0100
xsd comparing tag contents
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.