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

RE: Get value from $Variable

Subject: RE: Get value from $Variable
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 17 Mar 2009 10:13:29 -0000
RE:  Get value from $Variable
> This code was crappy and has been changed to this:
> 
>      <xsl:for-each select="Weekdays/Day">
>           <xsl:variable name="Current_Id" select="@Id"/>
>           <xsl:value-of 
> select="$Language/Weekdays/Weekday[@Wd_Id = 
> $Current_Id]"/><xsl:if test="following-sibling::*[1]">, </xsl:if>
>      </xsl:for-each>
> 
> But I would like to skip the Current_Id variable, but when I 
> do like this:
> 
>      <xsl:for-each select="Weekdays/Day">
>           <xsl:value-of 
> select="$Language/Weekdays/Weekday[@Wd_Id = @Id]"/><xsl:if 
> test="following-sibling::*[1]">, </xsl:if>
>      </xsl:for-each>
> 

You can write select="$Language/Weekdays/Weekday[@Wd_Id = current()/@Id]"

Personally, though, I think I prefer the variable.

Michael Kay
http://www.saxonica.com/

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.