In your first posting, there is a for-each over a sequence of nodes, and
one line is created for each item. You can number this (as Martin has
written - why didn't you follow up on his proposal?) by doing
<xsl:template match="/">
<xsl:for-each select="x/y/z/amount">
<xsl:variable name="pos" select="position()"/> <!-- position
within the for-each -->
<!-- lots of other stuff omitted -->
<xsl:value-of select="$pos, LIBPROD','
'"/>
</xsl:for-each>
</xsl:template>
If you match nodes by descending through the input document (using template
and apply-templates) you can also establish the ordinal of the currently
matched node, this time by calling index-of, e.g.
<xsl:template match="amount">
<xsl:variable name="pos" select="index-of( /x/y/z/amount, .)"/>
<xsl:value-of select="$pos,.,'
'"/>
</xsl:template>
BTW, both functions (position, index-of) would have turned up in prominent
positions after googling for "XSLT position within sequence".
Cheers
-W
On 3 November 2014 22:56, Catherine Wilbur cwilbur(_at_)uwindsor(_dot_)ca <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <-list/528976> (by
email <>)
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--