<html> <script language="javascript"> <xsl:comment> function sort(key) { // Find the "for-each" attributes in the style sheet. var s = document.XSLDocument.selectSingleNode("//xsl:for-each");
if (key=="") s.removeAttribute("order-by"); else s.setAttribute("order-by",key);
// Find the subset of the document we need to update. var xmldoc = document.XMLDocument.selectSingleNode("singer/songs"); var xsldoc = document.XSLDocument.selectSingleNode("//div[@id='in']");
// Apply the style sheet to the subset, and update the display. divItems.innerHTML = xmldoc.transformNode(xsldoc); }