|
[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...
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








