You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Zmitko, Jan" <Ja...@Dresdner-Bank.com> on 2005/06/24 11:01:59 UTC
XSL Transformation - many XSL Imports - Performance???
Hi,
I´ve a question mentioned the performance of the XSL Transformation. I need
a XSL Stylesheet which is dynamic against a specific context. So I use a lot
of import statements for Stylesheets, but not all Stylesheets are allways
used.
What happens, if the XSLT Processor worked up the importstatements? Can
these steps have a adverse effect for performance?
Can someone help me with these question?
Thanks a lot,
Jan
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="headerLogo.xsl"/>
<xsl:import href="bodyI.xsl"/>
<xsl:import href="bodyII.xsl"/>
...............
...............
<xsl:import href="footerI.xsl"/>
<xsl:import href="footerII.xsl"/>
............
............
Re: XSL Transformation - many XSL Imports - Performance???
Posted by Jeremias Maerki <de...@greenmail.ch>.
Not if you make sure to reuse the stylesheet. If you use JAXP you need
to make sure that you don't load the stylesheet every time when you do a
conversion like this:
Transformer transformer = tFactory.newTransformer(new StreamSource(mystylesheet));
You need to get the Templates object (which represents the stylesheet) and
reuse that:
//do this once
Templates templates = tFactory.newTemplates(new StreamSource(mystylesheet));
//do this for each conversion
Transformer transformer = tfactory.newTransformer(templates);
I hope this helps.
On 24.06.2005 11:01:59 Zmitko, Jan wrote:
> Hi,
>
> I´ve a question mentioned the performance of the XSL Transformation. I need
> a XSL Stylesheet which is dynamic against a specific context. So I use a lot
> of import statements for Stylesheets, but not all Stylesheets are allways
> used.
>
> What happens, if the XSLT Processor worked up the importstatements? Can
> these steps have a adverse effect for performance?
>
> Can someone help me with these question?
>
> Thanks a lot,
>
> Jan
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:import href="headerLogo.xsl"/>
>
> <xsl:import href="bodyI.xsl"/>
>
> <xsl:import href="bodyII.xsl"/>
>
> ...............
>
> ...............
>
> <xsl:import href="footerI.xsl"/>
>
> <xsl:import href="footerII.xsl"/>
>
> ............
>
> ............
>
>
>
>
>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org