Subject: Re: [xsl] NodeTest expected here - problem with creating xsl:key from document(url) From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 26 Aug 2002 18:40:06 -0400 |
I'm trying to create a key based on the contents of an external 'lookup' document, i.e. something like:
<xsl:key name="keyedLookupTable" match="document('LookupTable.xml')/LookupTable/Value" use="@key"/>
Is this allowed? I get a 'NodeTest expected here' error. I've tried a few alternatives (e.g. first assigning the external doc to a variable then using match="msxsl:node-set($myVariable) etc).
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <Output> <xsl:for-each select="/Data/key"> <xsl:variable name="currentKey" select="."/> <xsl:variable name="lookupValue"> <xsl:for-each select="$Lookup"> <!-- this for-each does nothing but change the context node for us --> <xsl:value-of select="key('keyedLookupTable' , $currentKey)"/> </xsl:for-each> </xsl:variable> <data> <xsl:value-of select="$lookupValue"/> </data> </xsl:for-each> </Output> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] how to append a "," to th, Mac Rost | Thread | RE: [xsl] NodeTest expected here - , Wendell Piez |
RE: [xsl] how to append a "," to th, Macaulay,Malcolm (US | Date | [xsl] selecting boolean from a choo, Richard von Keyserli |
Month |