Subject: [xsl] xsl:key within <xsl:for-each select="xalan:nodeset... From: subbu@xxxxxxxxxxxx Date: Thu, 08 Aug 2002 13:50:55 +0100 |
Hello ppl I am tryin to call a xsl:key within <xsl:for-each select="xalan:nodeset($myVar)/myElement"> like.. <xsl:for-each select="xalan:nodeset($myVar)/myElement"> <xsl:value-of select="key('names',nameid)/name"/> </xsl:for-each> The value-of select produces no result. and if i keep this out of the for-loop( of the xalan:nodeset ) with a hard coded value of the name id like.. <xsl:value-of select="key('names','1')/name"/> i would get the required result. within the above for loop even the hard coding doesnt work. Is there any thing i am missing out regarding the behaviour??? Is it not possible to refer to the key like this from the for loop? in this perticular case if i want to refer to the key, then what should i do ? FYI.. key is declared as.. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan = "http://xml.apache.org/xalan" exclude-result-prefixes="xalan"> <xsl:output method="text" omit-xml-declaration="yes"/> <xsl:key name="names" match="/students/namelist/name" use="@id"/>.. and the namelist element looks like <students> <namelist> <name id = "1">John</name> <name id = "2">Linda</name> </namelist> </students> Thanks for your help -------------------------------------------------------------- Sent with "Me-Mail", Boltblue's FREE mobile messaging service. http://www.boltblue.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] optimize XPath query to s, G. Ken Holman | Thread | RE: [xsl] xsl:key within <xsl:for-e, Michael Kay |
[xsl] optimize XPath query to speed, Charlie G. | Date | B Re: [xsl] XSL and Xalan, by way of Mulberry T |
Month |