dynamically showing/hiding a row

Here should go questions about transforming XML with XSLT and FOP.
Posts: 5
Joined: Sat Jun 04, 2005 1:31 am

dynamically showing/hiding a row

Post by syxxzonz » Mon Jun 06, 2005 10:44 pm

I have the following:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" />
<xsl:template match="/database">
<script type="text/javascript">
function show_hide()
var st1;

if(button1.value=="Hide Name")
button1.value="Show Name";
button1.value="Hide Name";

var tb1 = document.getElementById("main");
var rows = tb1.getElementsByTagName("tr");

for (var row=0; row<rows.length; row++)
var cels = rows[row].getElementsByTagName("td");


function show_hide_tran()
if(button2.value=="Hide Transactions")

button2.value="Display Transactions";
button2.value="Hide Transactions";


<input type="button" id="button1" value="Hide Name" onClick="show_hide()"/>
<input type="button" id="button2" value="Hide Transactions" onClick="show_hide_tran()"/>
<table id="main" border="3" cellspacing="1" cellpadding="1">
<xsl:apply-templates select="element"/>

<xsl:template match="element">
<xsl:apply-templates select="customer" />
<xsl:apply-templates select="transaction" />

<xsl:template match="customer">
<td><xsl:apply-templates select="name"/></td>
<td><xsl:apply-templates select="order"/></td>
<td><xsl:apply-templates select="price"/></td>

<xsl:template match="transaction">
<tr class="special">
<td><xsl:apply-templates select="day"/></td>
<td colspan="2"><xsl:apply-templates select="time"/></td>



what I want to do is with the click of a button (button2) I want to show/hide the rows that have the class name "special". I want to do this through a function that is called by the click of button2. Any help will be greatly appreciated. thank you!!