File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Not getting my variable value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Not getting my variable value" Watch "Not getting my variable value" New topic

Not getting my variable value

Piyush Rathore

Joined: May 21, 2002
Posts: 11
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="" version="1.0">
<xsl:param name="calparam"><xsl:text></xsl:text></xsl:param>
<xsl:variable name="calc">
<xsl:value-of select="$calparam"/>
<xslutput method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<form name="myform">
<table id="main" border="1" width="100%">
<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="'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:value-of select="$type_of_cal"/>
<table id="tb_cal" border="1" width="100%" style="visibility:hidden">
<xsl:for-each select="//neurology_cal/type/*[$calc]">
<td width="33%">
<xsl:value-of select="local-name(.)"/>
Can anybody help in getting my dynamic variable declaration.
Edit Commentisabled smiles.
[ April 30, 2004: Message edited by: Madhav Lakkapragada ]

Software Engineer,
I agree. Here's the link:
subject: Not getting my variable value