I am using XSLT to transform xml file to html so it can be viewed in a browser.
My XSL file basically defines a number of tables (populated from my XML file).
My HTML file is like below:
<html>
<head>
<title>My Title</title>
<script type="text/javascript">
<!--
function applyXSLT()
{
// do transfrom
resultdiv.innerHTML = transformResults;
}
//-->
</script>
</head>
<body class="main" onLoad="applyXSLT()">
<div id="resultdiv"></div>
</body>
</html>
Everything is working at this point. Now I want to use jQuery to help with sorting on the tables.
My question is how do I do that? Where do I put the jQuery stuff?
Thanks in advance!
One approach of sorting is using xslt template sort the xml data, this is how you can sort in xslt:
Then you need to dynamicly change the sorting field based on the column.
Other approaches would be using some plugins to sort on the UI,jquery datatable, tablesorter etc.