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

Re: stylesheet organisation

Subject: Re: stylesheet organisation
From: Geert Bormans <geert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 02 Sep 2011 17:40:41 +0200
Re:  stylesheet organisation
My 2cts

I break down my stylesheets in multiple smaller parts by definition
- by differentiating include and import smartly, I have good hooks for customization
- it helps me when I am unit testing parts of the code. I develop a test harnas first, for developing and testing tricky functions, most of the time,
and build the function in separate files for include. So I only migrate tested code in production branches, and I am not bothered by existing code
- all my code is in subversion repositories at least somewhere. Smaller files help collaboration, allowing me to work on one part whilst someone else is working on another part


I definitely don't agree that include/import is only useful for reuse of code in different projects

Since I am often not alone when working on a larger project,
maintainability is an important requirement
And having multiple smaller files helps collaboration

I try to have my includes of common function libraries top level only
(but having multiple includes of the same library usually doesn't hurt since there are enough imports in between)
I do have stubs that do nothing but including other stylesheets


And Oxygen's features are important for maintaining all this

cheers

Geert

At 13:11 2/09/2011, you wrote:
Hi all,

Friday question... I'd like to see if concensus has emerged about
stylesheet organisation.  Do you:

a) stick to one large file (where possible)

b) break down the xslt into smaller stylesheets that are
included/imported into an entry point stylesheet

If you use b), how do you handle common imports (such as a
functions.xslt, variables.xslt, common.xslt etc) ?

Do you import them once (say in the entry point stylesheet) and rely
on tools to be aware of that, or do you import them everywhere they
are used and rely on import precendence to sort it out?

I've also seen it done where each stylesheet contains little more than
1 or 2 templates, and those stylesheets are imported by stylesheets
which contain nothing other than import statements, and those 'import'
stylesheets are in turn imported by other stylesheets... personally I
hated that, but I could understand its intentions.

Any other techniques? Is there a common style yet?



--
Andrew Welch
http://andrewjwelch.com

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.