• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Not getting my variable value

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having problem with my variable declaration in select option for xsl.
I got all my relative values for select options, now if i click on any option, i want to display the childs for subsequent node in a seperate <td>in form of table. I am unable to get my 'calc' variable in tb_cal table id which i am declaring in select option.
Here it is
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="calparam"><xsl:text></xsl:text></xsl:param>
<xsl:variable name="calc">
<xsl:value-of select="$calparam"/>
</xsl:variable>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<form name="myform">
<table id="main" border="1" width="100%">
<tr>
<td width="50%">
<select name="param" size="4" style="text-align:left; visibility:visible; line-height: 150%; word-spacing: 2; border: 3px ridge #808000; margin-top:1" onchange="tb_cal.style.visibility='visible'">
<xsl:for-each select="//neurology_cal/type/*">
<xsl:variable name="type_of_cal" select="local-name(.)"/>
<option value="{$type_of_cal}">
<xsl:if test="$calparam=$type_of_cal">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$type_of_cal"/>
</option>
</xsl:for-each>
</select>
</td>
<td>
<table id="tb_cal" border="1" width="100%" style="visibility:hidden">
<tr>
<xsl:for-each select="//neurology_cal/type/*[$calc]">
<td width="33%">
<xsl:value-of select="local-name(.)"/>
</td>
</xsl:for-each>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Can anybody help in getting my dynamic variable declaration.
------------------------------------------------------------------------
Edit Comment:Disabled smiles.
[ April 30, 2004: Message edited by: Madhav Lakkapragada ]
 
pie. tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic