This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:key
- To: xsl-list at mulberrytech dot com
- Subject: xsl:key
- From: Mike Engelhart <mengelhart at earthtrip dot com>
- Date: Fri, 10 Mar 2000 13:56:30 -0600
- Reply-To: xsl-list at mulberrytech dot com
Does <xsl:key> require that you traverse a DOM tree every time you use the
key() function? All the examples I've seen and all the ways I've tried to
use it seem to require me to do a loop through the lookup table like this:
<xsl:key name="translate" match="phrase" use"@key"/>
<xsl:for-each select="document('translator.xml')"/>
<xsl:value-of select="key('translate', '_some_phrase')"/>
</xsl:for-each>
Is there no way to have a top level stylesheet hold 'translator.xml' and
then just call <xsl:value-of select="key('translate', '_some_phrase')"/>
from anywhere in the stylesheet?
The reason I want to use keyspaces is to display web content based on the
browsers language setting. This is trivial with a java extension but I'm
trying to have an XSL only version that does the same thing.
Also if anyone knows of any examples of using keyspaces, please let me know.
thanks,
Mike
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list