Subject: Re: [xsl] for vs. for-each From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sun, 14 Mar 2021 21:47:01 -0000 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] for vs. for-each, Wendell Piez wapiez@ | Thread | [xsl] sorting, xslt 2.0, Dave Pawson dave.paw |
Re: [xsl] for vs. for-each, Wendell Piez wapiez@ | Date | Re: [xsl] for vs. for-each, Dimitre Novatchev dn |
Month |