Subject: Re: Loading an external file of index From: Pierre Attar <patt@xxxxxxxxx> Date: Thu, 22 Jun 2000 23:32:14 +0200 |
============================= Transforming... XPATH: Can not convert #UNKNOWN to a NodeList! Xalan: was not successful. XSLProcessor: done
Unfortunately, I know from struggling with some fairly recent questions that this doesn't work. You can't use the document() function within the 'match' attribute of xsl:key. Instead, define the key as if the input document was the one with the keys in, at the top level of the stylesheet:
<xsl:key name="mysetofkeys" match="/keybase/key" use="@name" />
Then, when you want to use it, put the key() function within an xsl:for-each that has the document that holds the keys as its 'select' attribute:
<xsl:template match="keyref">
<xsl:variable name="keyrefname" select="@name" />
<xsl:for-each select="document('../shared/shared.xml')">
<b><xsl:value-of select="key('mysetofkeys', $keyrefname)/ACRONYM" /></b>
</xsl:for-each>
</xsl:template>
This is kind of explained in the XSLT Recommendation at http://www.w3.org/TR/xslt#function-key, right at the end of that section.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Loading an external file of ind, Jeni Tennison | Thread | Re: Loading an external file of ind, Eric van der Vlist |
Re: XSL FO to HTML Stylesheet, Nikolai Grigoriev | Date | Re: Loading an external file of ind, David_Marston |
Month |