xsl-list
[Top] [All Lists]

The right way to count from inside a match template

2005-03-09 11:59:33
Dear All,
 I am sure this is a old chestnut of a question, but I just cannot get
it to work.

I have an xsl which is something like this:

<root>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
<a><b>lots of stuff</b></a>
</root>

and I have a template 

<xsl:template match="a">

<!--Show which element I on using-->

<!--display lots of stuff-->

</xsl:template>

For the <!--Show which element I on using--> I am trying various
different combinations
of <xsl:number value="something">

I have tried counting preceding siblings, position and several other
things, and I only ever get
a 1. 

I would be really grateful if you could tell me What is the right way to
show 1,2,3,4,5 and then contents of each 'a´ element within the
template.

Thanks very much in advance,



--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>