xsl-list
[Top] [All Lists]

Re[2]: [xsl] numerating nodes in doc-flow

2007-01-25 07:31:53
Thank you very much. It works great!

Thursday, January 25, 2007, 4:53:49 PM, you wrote:

AW> On 1/25/07, Alexey Nickolaenkov <nikolaenkov(_at_)actimind(_dot_)com> wrote:
Hello guys!

I have to enumerate nodes in the document-flow order using xslt 1.0. I
thought that's not difficult but the following template does nothing.
Can you help me?

   <xsl:template match="node()">
      <xsl:param name="counter" select="0"/>
      <xsl:copy>
         <xsl:apply-templates select="@*"/>
         <xsl:attribute name="new_id" select="concat('item_', $counter)"/>
         <xsl:apply-templates select="occurrence/art">
            <xsl:with-param name="counter" select="$counter+1"/>
         </xsl:apply-templates>
      </xsl:copy>
   </xsl:template>

AW> Without sample input or output XML it's difficult to give a good
AW> answer, but its likely <xsl:number count="*" level="any"/> will give
AW> you the numbering you're after.

AW> cheers
AW> andrew




-- 
Alexey                            mailto:nikolaenkov(_at_)actimind(_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>
--~--