DTD/XML Sort dynamically

I’m displaying views in the browser through XML from a page and using a DTD stylesheet to display. I’m trying to make each column sortable, but I’m having a hard time figuring out how to sort the XML/DTD file after the fact outside of reloading a different DTD stylesheet with that parameter set. I’m trying to find a way to either dynamically re-sort the XML, or dynamically change the DTD file and re-transform the XML. In essence, I want to be able to update the DTD dynamically to change this value <xsl:sort select=“ticketnum” data-type=“number” order=“ascending”/> to indicate a different column through javascript.

Please help!!!

DTD source

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version=“1.0” xmlns:xsl=“XSLT Namespace”>

<xsl:template match=“/”>

All Open Tickets

<table width="100%" border="0" cellspacing="0" cellpadding="2">

<xsl:for-each select="helpdesk/colheader">

  <tr class="tableheader">

    <th><xsl:value-of select="col1"/></th>

    <th><xsl:value-of select="col2"/></th>

    <th><xsl:value-of select="col3"/></th>

    <th><xsl:value-of select="col4"/></th>

    <th><xsl:value-of select="col5"/></th>

    <th><xsl:value-of select="col6"/></th>

    <th><xsl:value-of select="col7"/></th>

    <th><xsl:value-of select="col8"/></th>

  </tr>

  </xsl:for-each>

  <xsl:for-each select="helpdesk/ticket">

  	<xsl:sort select="ticketnum" data-type="number" order="ascending"/>	

    <tr>

    <td class="ticketnumber"><xsl:value-of select="ticketnum"/></td>

    <td class="data"><xsl:value-of select="submitdate"/></td>

    <td class="data"><xsl:value-of select="branch"/></td>

    <td class="data"><xsl:value-of select="maincat"/></td>

    <td class="data"><xsl:value-of select="subcat"/></td>

    <td class="data"><xsl:value-of select="requestor"/></td>

    <td class="data"><xsl:value-of select="onbehalf"/></td>

    <td class="data"><xsl:value-of select="assigned"/></td>

  </tr>

  </xsl:for-each>

</table>

</xsl:template>

</xsl:stylesheet>

Subject: AddParameter method

Hi Wayne,

If you are using the LotusScript NotesXSLTransformer class, check out the AddParameter method.

Call notesXSLTransformer.AddParameter( ParameterName, ParameterValue )

Then you can reference the parameter as $ParameterName in your XSL style sheet. This may help you accomplish what you want.

P.S. I believe you are saying DTD where you really mean XSL or XSLT.

Subject: DTD/XML Sort dynamically

I was also thinking if it’s possible to drive the template name used where as I could store different templates within the same DTD file and then use JS to determine which template is used to transform the information.