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

Re: expression comparing node and variable

Subject: Re: expression comparing node and variable
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Tue, 20 Jun 2000 23:07:28 +0200
Re: expression comparing node and variable
Laura Price wrote:
> 
> I'm probably overlooking something simple here... i hope.

Yes ;=) ...
 
> I have this variable:
> <xsl:variable name="currentsection>other stuff</xsl:variable>
> 
> then I have 3 elements:
> <section>some stuff</section>
> <section>more stuff</section>
> <section>other stuff</section>
> 
> I want them to appear as
> <section>some stuff</section>
> <section>more stuff</section>
> <highlight><section>other stuff</section></highlight>
> 
> I've put in my stylesheet:
> <xsl:for-each select="section">
>    <xsl:choose>
>         <xsl:when test="section=$currentsection">

"section", in this context, would mean a section element child of the
current node (already being section).

As you don't have any child node, you've got no chance to pass here...

>                 <highlight><xsl:value-of select="section"/></highlight>

BTW, here, the xsl:value-of will return the text value of a section
child element.

>         </xsl:when>
>         <xsl:when test="not(section=$currentsection)">
>                 <xsl:value-of select="section"/>
>         </xsl:when>
>    </xsl:choose>
> </xsl:for each
> 
> but the first <xsl:when> stuff never gets executed... have i messed up the
> expressions, or is it something else?

The old tricks used to debug "classical" languages can apply to this
kind of debugging.

In this case, displaying the values you're testing before testing them
would have help to diagnoze what's going wrong.

Hope this helps.

Eric

-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------


 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.