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

Re: Numbering similar nodes sequentially in the output

Subject: Re: Numbering similar nodes sequentially in the output
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Wed, 12 Oct 2011 13:59:25 -0700
Re:  Numbering similar nodes sequentially in the output
Hi ken,
My gut feeling is that thee is no helpful pattern in selecting the members of the output. Building a temporary tree is just the thing. I had no idea that I could do that. I'll do some reading up on them and try it.


On another topic, thanks for the lead on the Crane publications.

Thanks,
Mark

-----Original Message----- From: G. Ken Holman
Sent: Wednesday, October 12, 2011 1:40 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Numbering similar nodes sequentially in the output


At 2011-10-12 13:32 -0700, Mark wrote:
I suspect this cannot be done, but will ask. Is it possible to sequentially number similar nodes in the output?

This is done in two ways: finding a pattern in how you collect the members of the output, or building an intermediate output in a temporary tree and then numbering the output copying the temporary tree to the result.

The original position() of the <Formats> in the input file is most likely irrelevant and misleading, and I suspect trying to count the different input <Formats> may be just as useless.

Then go with the temporary tree (though it can sometimes be surprising how patterns reveal themselves in the data). Build your output in the temporary tree and then, as you are copying the tree to the result, you can use position() and count() on the nodes of the tree.

I hope this helps.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

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-2013 All Rights Reserved.