|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Cannot select a node here: the context item is an
As always, that did the trick. Assigning the sequence to a variable
outside of the loop is the solution.
Thanks!
On Apr 5, 2005 11:28 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> You'll need to set a variable outside the outer loop, and in the inner loop
> do something like
>
> <xsl:for-each select="$s/my/xpath/query[@day=$day]">
>
> In fact, you might as well select the whole path in the variable and just
> use
>
> <xsl:for-each select="$s[@day=$day]">
>
> I would tend to use .-1 rather than position()-1, but the effect is the
> same. Actually, I would probably not build the duration from a string, but
> rather from:
>
> <xsl:variable name="one-day" select="xs:dayTimeDuration('P1D')"/> (global
> variable)
>
> then in the loop:
> <xsl:variable name="day" select=". * $one-day"/>
>
> Michael Kay
> http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








