This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XSLT design good practice


Antony,

>Is anyone aware of sources of wisdom on the question of XSLT stylesheet
>design good practice / usage guidelines? I have some ideas myself (which
I'd
>be happy to share) but would be interested to know if there's existing
>material around.

>I'm thinking of issues such as use of named templates, parameters and
>variables, importing/including and so on, and how would these map against
>programming objectives such as maintainability, maximum re-use, simplicity,
>economy of code and so on.

I don't know what applications you have in mind, but if you're using XSL to
produce HTML the following conclusions may be of interest, based on recent
tests aimed solely at speeding up the XSLT transformation time on some
rather complex xsl files.  This was using apache Cocoon with Xalan 1.03 and
Xerces 1.04.  Email me if interested in technical specs.

1. For any "static" html portions of the page (such as headers, footers, nav
bars), it's definitely more efficient to store the snippets as external xml
files & copy them to the output tree using xsl:copy-of and the document()
function, rather than using a named template and xsl:import.

2. (rather obvious)- If you can help it, don't xsl:import any more xsl than
you need.  For example, we had a 43kb file "library.xsl" with various
templates that were used to perform often used functions- format dates
differently, create month/day/year drop-down lists, etc.  and found that,
quite naturally, when we broke this file up into 8 smaller ones, it was
faster (up to a certain point) to import just the required portions than the
whole thing.  However, it was faster to process the entire 43kb file, even
with unneeded templates, than to process all 8 atomized files.

Hope this helps.

mark giacobbe
mgiacobbe@smallworld.com



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]