File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Not getting my variable value

Piyush Rathore
Greenhorn

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="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 ]

Software Engineer,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not getting my variable value