• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not getting my variable value

 
Piyush Rathore
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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>
<xslutput 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 Commentisabled smiles.
[ April 30, 2004: Message edited by: Madhav Lakkapragada ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic