xsl-list
[Top] [All Lists]

Re: [xsl] Get value from $Variable

2009-03-17 06:30:14
Hi Florent and Michael

Thank you about the current() - I'll go for that since I dont like
declaring the variable on every walk.

@Florent, sorry about my name :) -- I have changed it in my Thunderbird ;)

Med venlig hilsen
Michael Nielsen

Se min fotoblog på:

www.photofolio.dk - A study in photography
<http://feeds.feedburner.com/%7Er/photofoliodk/%7E6/1>




Michael Kay wrote:
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[(_at_)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[(_at_)Wd_Id = @Id]"/><xsl:if 
test="following-sibling::*[1]">, </xsl:if>
     </xsl:for-each>

    

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

Personally, though, I think I prefer the variable.

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


  



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>