xsl-list
[Top] [All Lists]

Re: [xsl] Get value from $Variable

2009-03-17 06:10:05

XSL-List wrote:

  Hi,

  BTW, the name XSL-List, I thought that was Tommie writing...

<xsl:value-of select="$Language/Weekdays/Weekday[(_at_)Wd_Id = @Id]"/>

I get the same day of the week (1) with this query. Is it
possible to get it some other way without the Variable?

  That's because '[' changes the current item.  So [(_at_)Wd_Id = @Id] accesses 
two attributes, named Wd_Id and Id, from the same node.  There are two 
solutions: using a variable, or using current().  current() returns the context 
node at the beginning of the XPath expression (right before evaluating 
$Language in your example):

    $Language/Weekdays/Weekday[(_at_)Wd_Id = current()/@Id]

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/



























--~------------------------------------------------------------------
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>