1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<script type="text/javascript">
<![CDATA[
var XMLsource = new Object;
var XSLsource = new Object;
XMLsource = document.XMLDocument;
XSLsource = document.XSLDocument;
function changeSort(newSortSelect) {
XSLsort=XSLsource.documentElement.selectNodes("//xsl:sort");
sortOrder=XSLsort[0].getAttribute('order');
sortSelect=XSLsort[0].getAttribute('select');
if (sortSelect == newSortSelect) {
if (sortOrder=='ascending') {
(XSLsource.selectNodes("//xsl:sort"))[0].setAttribute('order', 'descending');
}
if (sortOrder=='descending') {
(XSLsource.selectNodes("//xsl:sort"))[0].setAttribute('order', 'ascending');
}
} else {
(XSLsource.selectNodes("//xsl:sort"))[0].setAttribute('select', 'newSortSelect');
(XSLsource.selectNodes("//xsl:sort"))[0].setAttribute('order', 'ascending');
}
document.body.innerHTML = XMLsource.transformNode(XSLsource);
}
]]>
</script> |