[xsl] How to use xsl:key for another document()

Subject: [xsl] How to use xsl:key for another document()
From: Janning Vygen <vygen@xxxxxxxxxxxx>
Date: Tue, 31 Jul 2001 08:52:21 +0200
Hi,

I can use xsl:key only in my source tree, but how can i create a key 
for another document?

what i would like to do is:

<xsl:variable name="doc1" select="document('doc1.xml'"/>
<xsl:key name="more-chapters" match="$doc1//chapter" use="@id"/>

But it doesnt work, of course, because its a match and not a select 
attribute. But i could not either change the context document with

<xsl:for-each select="$document">
  <xsl:key name="more-chapters" match="chapter" use="@id"/>
<xsl:for-each>

because xsl:key is a top-level element.

Is there another way to achieve this?

janning

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread