Hi There,

I've not been following this thread as closely as I might, so someone might have 
already mentioned this:

If you use a string() function on your document value as below:

<xsl:variable name="lang"><xsl:value-of 
select="string(document('cocoon:/getxml')/context/lang)"/></xsl:variable>

Then you will forevermore be accessing only the value, not the entire document :)

Some might say it's a little hacky, but it is a simple fix which works.

HTH,

Corin

-----Original Message-----
From: Nils K�ster [mailto:[EMAIL PROTECTED]
Sent: Monday, 3 May 2004 9:20 a.m.
To: [EMAIL PROTECTED]
Subject: document() in xsl:variable -> low performance


Hello,

In a stylesheet, I have this in the first line, outside of any template:

<xsl:variable name="lang"><xsl:value-of 
select="document('cocoon:/getxml')/context/lang"/></xsl:variable>

In the templates of this xsl I use the variable $lang about 40 times. The procession 
of this stylesheet is very slow.

When I reduce the use of the variable $lang to one or none, it's very fast. When I use 
"en" (without quotes) instead of <xsl:value-of 
select="document('cocoon:/getxml')/context/lang"/> it's very fast, as well.

--> Does that mean, that everytime I use $lang cocoon executes
document('cocoon:/getxml') ??
--> How can I avoid that?

Regards,
Nils


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


================================================================
CAUTION: This e-mail and any attachment(s) contains information
that is intended to be read only by the named recipient(s). It
may contain information that is confidential, proprietary or the
subject of legal privilege. This information is not to be used by
any other person and/or organisation. If you are not the intended
recipient, please advise us immediately and delete this e-mail
from your system. Do not use any information contained in it.

================================================================
For more information on the Television New Zealand Group, visit
us online at http://www.tvnz.co.nz
================================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to