rem: var img = document.createElementNS("http: 
add: var img = document.createElementNS("http: 
context: function addToToc(root, tocFrame){  var i;  var newTocFrame = tocFrame;  var newTocElement = null;  var newTocLink = null;  for (i=0; i < searchTags.length; i++) {    if (root.tagName == searchTags[i]) {      // If we've found a structural element, create the      // equivalent TOC element.      newTocElement = document.createElement(tocTags[i]);      // Create the toclink element that is a link to the      // corresponding structural element.      newTocLink = document.createElement("toclink");      newTocLink.setAttributeNS("http://www.w3.org/1999/xlink","xlink:type", "simple");      newTocLink.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href", "#"+ root.getAttribute("id"));      newTocLink.setAttributeNS("http://www.w3.org/1999/xlink","xlink:show", "replace");      newTocElement.appendChild(newTocLink);      // Create the image and toggling container in the table of contents      if (i < searchTags.length-1) {        var img = document.createElementNS("http://www.w3.org/1999/xhtml","html:img");        img.src = "minus.gif";        newTocElement.insertBefore(img,newTocLink);         newTocFrame = document.createElementNS("http://www.w3.org/1999/xhtml","div");        newTocElement.appendChild(newTocFrame);      }      else {        newTocFrame = null;      }      tocFrame.appendChild(newTocElement);      break;    }  }  // Recurse down through the childNodes list  for (i=0; i < root.childNodes.length; i++) {    var child = root.childNodes[i];    if (child.nodeType == Node.ELEMENT_NODE) {      if ((newTocLink != null) && (child.tagName == "title")) {        var text = child.firstChild.cloneNode(true);        newTocLink.appendChild(text);      }      else {        addToToc(child, newTocFrame);      }    }  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/55a5667dd2ae1103a39b714a4f4d44cb6f63c162/toc.js/buggy/content/xml/tests/toc/toc.js