[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: Florent Georges <lists@xxxxxxxxxxxx>
Date: Tue, 17 Mar 2009 10:09:23 +0000 (GMT)
Re:  Get value from $Variable
XSL-List wrote:


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

> <xsl:value-of select="$Language/Weekdays/Weekday[@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 [@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[@Wd_Id = current()/@Id]


Florent Georges

Current Thread


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.
First Name
Last Name
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.