Subject: Re: Numbering new nodes using consecutive integers
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 27 Mar 2009 13:35:23 -0400
|
Hi,
At 12:40 PM 3/27/2009, you wrote:
I added an additional level <G2> to a hierarchy of <Groups> and <G1>.
I want to assign numbers to the newly created <G2> nodes, which identify
them in the document. I managed to do so using <xsl:number>.
Now it would be perfect if the numbering was done as a strict sequence
of consecutive integers, meaning 1,2,3 instead of, say, 1,3,5.
Can this be done in 1.0, or 2.0, for that matter?
In addition to David's and Ken's suggestions, here's a Gordian knot
solution to consider -- is there any reason why this has to be done
in a single pass?
The numbering would be trivially easy in a second pass.
In general, I agree that this isn't really a job for xsl:number,
whose primary application is to generate numbers relative to the
source tree, not the result.
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
|