[xsl] key() and document() - scoping problem?

Subject: [xsl] key() and document() - scoping problem?
From: "Bryn Lewis" <blewis@xxxxxxxxxx>
Date: Tue, 19 Dec 2006 19:15:54 +1100
I have defined a key, then use its value in the following xsl (xslt v.1):

<span class="x">
	<xsl:value-of select="count(key('key2_1', 'general'))" />
</span>
<xsl:for-each select="document(string($options))/options/option">
	<span class="y">
		<xsl:value-of select="count(key('key2_1', 'general'))" />
    	</span>
</xsl:for-each>

Results in this:

<span class="x">4</span>
<span class="y">0</span>

I would expect to get a '4' in both cases.

The document referred to is referenced correctly and I would be using it to
specify the key value required.

The document seems to throw the key out of scope, but I dont see how to
correct that.

thanks, Bryn

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.24/592 - Release Date: 18/12/2006
1:45 PM

The contents of this email and any attachments are confidential and may be
privileged
or otherwise protected from disclosure.

If you are not the intended recipient of this email
please notify the sender immediately, delete the email and
any attachments from your system and do not print, distribute,
store, commercialise or act on any information it contains.

Current Thread