xsl-list
[Top] [All Lists]

Re: [xsl] position() function in loop provides only 1

2012-04-11 07:06:28
In for each the context will switch, so position will be reset inside
You could keep position in a variable if you need it.

Michel

On Wed, Apr 11, 2012 at 1:57 PM, henry human <henry_human(_at_)yahoo(_dot_)de> 
wrote:
Hi all
I use the positon() funciton to build a counter.
I use it in a for-each loop under another for-each. The result is but ever 1.
Strange, but in the same document in the first for-each loop it works fine 
(bellow is first loop, for-each select="Item)
sample document look like this:


<xsl:for-each select="Item">
<it>
<xsl:value-of select=" position()">

</it><it>
<xsl:value-of select=" position()">
</it>
........
<it>
//position  = 113
</it>
</xsll:for-each>
<xsl:for-each select="InvoiceLine">
   <xsl:for-each select="taxtotal">
....
<xsl:value-of select=" position()">
   </xsll:for-each>
  </xsll:for-each>
------

<invoiceLine>
<taxtoatl>
</taxtoal>

<taxtotal>
</taxtotal>
...........
</invoiceLine>
kind regards
Henry

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--