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

Re: How to mark every 5th output record.

Subject: Re: How to mark every 5th output record.
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 11 Mar 2008 14:20:59 +0000
Re:  How to mark every 5th output record.
On 11/03/2008, Patrick Bergeron <pbergeron@xxxxxxxxxxx> wrote:
>  As I said the rules under which I process my list are quite complex. So much
>  so that my XSLT stylesheet is over 2900 lines of code (and yes, that's just
>  nuts).

That's actually quite normal with XSLT.  Someone once suggested 1
template per file in an attempt to make a large stylesheet of mine
more "managable"... which is of course nonsense.

Modularize your stylesheets when its appropriate, but don't do it just
because 2900 lines seems large.


>  Is my only option to create another tree that contains all of my output
>  record results, and then iterate over that tree once again, and putput the
>  same data verbatim, only this time insert a marker every 5th?
>
>  Gheesh, talk about using a tank to shoot a bird.

Again that's really common technique, is good practice and good
architecture for a transform - separate out your problem into steps
and do one step at a time.  Once it's producing the correct output
then think about whether it really is a problem - you might find that
actually the separation of the steps helps you solve most of problems
you come across in the future as the requirements change.

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.