cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya A. Kriveshko" <>
Subject Poor performance of document() in XSL [Was: Re: simpel cocoon question]
Date Tue, 05 Nov 2002 14:32:34 GMT
SAXESS - Hussayn Dabbous wrote:

> <snip/>
> But you also could do it directly within the xslt context:
> You can use the document() function in your XSLT-file.
> This function allows you to refer to data contained within
> another XML-file. This is completely decoupled from cocoon
> though. It's more about how to work with XSLT:
> <snip/>

In the past I have encountered a nasty performance problem with document().
For example, when you declare an xsl variable that gets its value from a 
and then use its value several times throughout the stylesheet, the URI 
of the document
gets hist as many times as there are references to that variable. I.e. 
the xsl variable
does not store the XML fragment it was given at the variable definition 
time, but
merely stores the XPath string and then resolves it every time it's 
This may or may not be true for XPath expressions that do not contain 
as well. Does anyone know for sure?


<xsl:variable name="test-me" 

<xsl:template match="/">
    <xsl:value-of select="$test-me"/>
    <xsl:value-of select="$test-me"/>
    <xsl:value-of select="$test-me"/>

When using Xalan, this example will cause the Cocoon pipeline that
is responsible for "gimme-sumthn" to be hit three times. I say,
document() is good for rapid prototyping, but is a poor choice for final
deployment for performance reasons. Use aggregation instead.


Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message