[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

Subject: Re: Cannot select a node here: the context item is an atomic value
From: chris <oneskiingfool@xxxxxxxxx>
Date: Tue, 5 Apr 2005 16:47:19 -0600
looping through context items
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/

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.