XSL and XML onclick table heading

wxdqz

New Member
This is my XML file where I set up a table - this is only part of it:


<heading text="id" columnName="ID" js="sortByColumnHeading();"/>
<heading text="Name" columnName="FULL_NAME" js="sortByColumnHeading();"/>

This is the part of the XSL that formats the above part of the XML:


<tr bgcolor="#5d7ca0">
<xsl:for-each select="heading">
<xsl:choose>
<xsl:when test="@text='Delete' or @text='Edit' or @text='Done' or @text='id'">
<td class='tableHeaderText'><xsl:value-of select="@text"/></td>
</xsl:when>
<xsl:otherwise>
<td style="cursor: pointer; cursor: hand;" OnMouseOver="this.style.backgroundColor='#EEEEFF'" OnMouseOut="this.style.backgroundColor='#5d7ca0'" >

<xsl:value-of select="@text"/>

<xsl:attribute name="onClick">
<xsl:value-of select="@js"/>
</xsl:attribute>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>


The problem is that I do not get the heading when I have the JS onclick attribute. When there is no attribute in there - this is in the xsl:otherwise statement, the headings come up.

I would like to have the headings and the JS working.

Cheers anyone
 
Back
Top