[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: for vs. for-each
On Sun, 2021-03-14 at 20:09 +0000, Wendell Piez wapiez@xxxxxxxxxxxxxxx wrote: > Hi, > > Another way to gloss this is that while "$values[.]" doesn't have the > intended effect, > > <xsl:for-each select="1 to count($values)"> > B B B <xsl:variable name="p" select="."/> > B B B <xsl:sequence select="$values[$p]"/> > </xsl:for-each> > > Oughta work just fine. I've often wished for, <xsl:for-each select="1to 20" at="pos"> as a short-cut for <xsl:variable as="xs:integer" select="position()" /> by analogy with XQuery, for $i at $pos in $sequence return ... But then, i tnd to try writing group by in XPath expressions too :) Liam -- Liam Quin,B https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org
|
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
|