liberty4all
Programmer
Hi, I am trying to sort an XML table dynamically, according to the header the user clicked on. In order to do that I need to select the sort node from the XSL file being used by the table, change its attributes and reload it.
For some reason this line returns null for me
this is my xsl file
any help would be greatly appreciated
For some reason this line returns null for me
Code:
set sortNode= docstyle.SelectSingleNode("//*[local-name()='sort']")
this is my xsl file
Code:
<?xsl version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] version="1.0">
<xsl:template match="/">
<html>
<table border="1">
<tr><th id="player" onClick="HeaderClick('PlayerName')">Player</th>
<th id="ppg" onClick="HeaderClick('ppg')">PPG</th>
<th id="total" onClick="HeaderClick('total')">Total</th>
<th id="gms" onClick="HeaderClick('gms')">Games</th>
</tr>
<xsl:apply-templates select="//row">
<xsl:sort select="@pts" data-type="number" order ="descending"/>
</xsl:apply-templates>
</table>
</html>
</xsl:template>
<xsl:template match="row">
<tr>
<td><xsl:value-of select="@playername"/></td>
<td><xsl:value-of select="@ppg"/></td>
<td><xsl:value-of select="@pts"/></td>
<td><xsl:value-of select="@gms"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
any help would be greatly appreciated