This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xsl:key


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]