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

Re: sanely ordering template imports?

Subject: Re: sanely ordering template imports?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 06 Dec 2011 20:01:41 +0000
Re:  sanely ordering template imports?
>I can't be the first person who has encountered this, so I'm wondering what you all do in situations like that. Do you simply take the hit of redundant import statements, or do you restructure your stylesheets?

A little war story: I was once presented with a stylesheet in which one module, called something like common.xsl, was imported by about 40 other modules, each itself part of the stylesheet. The result: every definition in common.xsl was compiled 40 times, and generated 40 copies of each of its compiled templates and global variables, each one at different import precedence. For templates at least, you can't just forget 39 of the instances, because a template that does xsl:next-match will invoke itself 39 times before finally calling the built-in template.

These days Saxon only compiles each template once, and has 40 small entries pointing to it, each representing the same rule but with different precedence. But it's still mighty inefficient. Try to avoid this kind of module structure.

Michael Kay
Saxonica

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.