xsl-list
[Top] [All Lists]

Re: [xsl] Help with using position()

2012-01-01 04:52:30
Vincenzo Menanno wrote:
A few more questions using the example below.

I have 1 xsl that gets me all the Calculations and using postion() function I 
am able to get the position number of the calculation.

<xsl:value-of select="position()"/>

All I want is a unique number or sequence number of each calculation. So is 
position() the most effective way to do this?

position() works as long as your for-each or apply-templates processes only the nodes you are interested in to number. In the more general case (for instance when you process all child elements but are only interested in numbering "foo" elements) you would use xsl:number (http://www.w3.org/TR/xslt#number) as in
  <xsl:number count="foo"/>




--

        Martin Honnen --- MVP Data Platform Development
        http://msmvps.com/blogs/martin_honnen/

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