[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Numbering new nodes using consecutive integers

Subject: Re: Numbering new nodes using consecutive integers
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 27 Mar 2009 13:35:23 -0400
Re:  Numbering new nodes using consecutive integers
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 ======================================================================

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.