Re: [xsl] Default actions in XSLT 2.1

Subject: Re: [xsl] Default actions in XSLT 2.1
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 3 Nov 2008 16:53:13 +0000
2008/11/3 Michael Kay <mike@xxxxxxxxxxxx>:
>> In 2.0 you also have the "initial template" parameter so you
>> can start the transform at any named template, which is much
>> more useful and kind of makes the initial mode parameter redundant.
> Yes, if I have a stylesheet with multiple entry points then I tend to use
> the "initial template" mechanism rather than "initial mode" to distinguish
> them. In principle I've always felt "initial mode" should be a good idea
> when you want to run one phase of a multi-phase stylesheet, but I've never
> had occasion to put this idea into practice.

It's exactly for that kind of transform that I've used initial
template - you have your seperate named templates for each step: maybe
"front page", "index", "chapters" whatever, and then you have an "all"
template which just calls each of them in turn.

That way you only run the lengthy "all" transform when you do the
final run, keeping transform times short during development of each of
the steps.

Even if there was a compelling use for initial mode, it wouldn't take
too much effort to wrap each mode in a named template.

Maybe someone on the list has found a good use for it?

Andrew Welch

Current Thread