[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:key within <xsl:for-each select="xalan:nodeset...

Subject: xsl:key within <xsl:for-each select="xalan:nodeset...
From: subbu@xxxxxxxxxxxx
Date: Thu, 08 Aug 2002 13:50:55 +0100
xsl for each key
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.