Re: [xsl] stylesheet organisation

Subject: Re: [xsl] stylesheet organisation
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 06 Sep 2011 14:54:16 -0400
Jesper,

On 9/3/2011 11:10 AM, Jesper Tverskov wrote:
I still need to boil it all down to something that is possible to
explain in a minute or two in order to really understand it!

That's not too hard. xsl:import allows introducing stylesheet components (variables, templates) at a lower "import precedence", while xsl:include doesn't. Import precedence is a powerful feature and very useful for some purposes, especially in modular stylesheets intended for customization using overrides. If you want this feature, use xsl:import. If you don't, use xsl:include.


The way import precedence works takes another minute to explain, plus another few minutes to cover fine points such as what happens with chains of imports. Plus, as Ken has remarked, you need to distinguish carefully between import *precedence* and the other means of resolving match conflicts, namely template *priority*; since both terms start with "pr-" this can be confusing for beginners.

Of course, even in my two-minute version, I lied, since as it happens, import precedence is the same mechanism used to resolve conflicts between a stylesheet's templates and the built-in templates (which are "imported" implicitly). But that's a detail not for the two minutes.

Cheers,
Wendell

======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread