Subject: Re: Dynamic include
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 12 Sep 2002 05:16:20 -0700 (PDT)
|
--- Peter Davis <pdavis152 at attbi dot com> wrote:
[first option skipped]
> * Or, why not make the source XML with the <include> tag into a
> stylesheet of
> its own? This will involve two stages of processing: the first
> outputs
> a
> stylesheet containing only the <xsl:include> elements, and the second
> uses
> the newly generated stylesheet to re-process the data using the
> included
> stylesheets. For example:
>
> + Output from first stage:
> <xsl:stylesheet ...>
> <xsl:include href="principal.xsl"/>
> <!-- taken from <include> element -->
> <xsl:include href="page1.xsl"/>
> </xsl:stylesheet>
>
> + Second stage uses the first stage's output stylesheet, and
> processes
> the
> input XML again (this time ignoring the <include> element).
>
> It should be possible to optimize the two stages to keep from parsing
> the
> source XML twice, by reusing the DOM tree if the data will fit into
> RAM.
>
> HTH
>
> --
> Peter Davis
It would be much more efficient to use a ***stylesheet skeleton***
file, in which to update (using DOM+XPath, e.g. setAttribute()) just
the value of the href attribute of the necessary xsl:import element.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|