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

Re: Annoying XSLT code

Subject: Re: Annoying XSLT code
From: JBryant@xxxxxxxxx
Date: Thu, 18 Aug 2005 15:28:03 -0500
Re:  Annoying XSLT code
> I agree that sometimes this can be overused and that tracking
> variable declarations across miles of files is no fun, but I
> also agree with David that it's a useful technique that can
> contribute to good code. A balance must be struck. Documenting
> your code (with comments if necessary) can also help the
> general problem of code opacity.

A useful "house rule": If you use anything from an imported stylesheet, 
add a comment at the point where it is first used in the current 
stylesheet that indicates the name of the stylesheet where it originated.

Some problems definitely lend themselves to being solved with multiple 
stylesheets. In those cases, I like to have a master stylesheet that lays 
out the whole solution and indicates which stylesheet implements which 
part of the solution. Then I add comments to the top of each stylesheet 
that identify the master and define what this particular stylesheet does.

I also write readme files and check them into source control, so that each 
stylesheet I write has at least minimal documentation somewhere in the 
same directory. I recently had to hand over one of our document production 
systems to a customer, and they were happy to see some documentation 
bundled with the source code. Even if it's not what I would call extensive 
documentation, they liked it better than what they usually get, which is 

I bet that, between us all, we could whip up a set of guidelines that 
would make a good set of XSLT coding conventions. It's mostly going to 
come down to don't obfuscate your code and do something to document 
(comments mostly) your code, but the specific ideas might be useful to 

Jay Bryant
Bryant Communication Systems
(presently consulting at Synergistic Solution Technologies)

Current Thread


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.
First Name
Last Name
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.