rem: var templateNode = getFirstChildByTagName("template", generatorNode); 
add: var templateNode = generatorNode.getElementsByTagNameNS(MICSUM_NS, "template")[0]; 
context:   initFromXML: function(xmlDocument) {    // XXX Make sure the argument is a valid generator XML document.    // XXX I would have wanted to retrieve the info from the XML via E4X,    // but we'll need to pass the XSLT transform sheet to the XSLT processor,    // and the processor can't deal with an E4X-wrapped template node.    // XXX Right now the code retrieves the first "generator" element    // in the microsummaries namespace, regardless of whether or not    // it's the root element.  Should it matter?    var generatorNode = xmlDocument.getElementsByTagNameNS(MICSUM_NS, "generator")[0];    if (!generatorNode)      throw Components.results.NS_ERROR_FAILURE;    this.name = generatorNode.getAttribute("name");    // Only set the source URI from the XML if we have a local URI, i.e.    // if this is a locally-installed generator, since for remote generators    // the source URI of the generator is the URI from which we downloaded it.    if (this.localURI) {      this.uri = generatorNode.hasAttribute("sourceURI") ?                 this._ios.newURI(generatorNode.getAttribute("sourceURI"), null, null) :                 this.localURI; // locally created generator without sourceURI    }    function getFirstChildByTagName(aTagName, aParentNode) {      var nodeList = aParentNode.getElementsByTagNameNS(MICSUM_NS, aTagName);      for (var i = 0; i < nodeList.length; i++) {        // Make sure that the node is a direct descendent of the generator node        if (nodeList[i].parentNode == aParentNode)          return nodeList[i];      }      return null;    }    // Slurp the include/exclude rules that determine the pages to which    // this generator applies.  Order is important, so we add the rules    // in the order in which they appear in the XML.    this._rules = [];    var pages = getFirstChildByTagName("pages", generatorNode);    if (pages) {      // XXX Make sure the pages tag exists.      for ( var i = 0; i < pages.childNodes.length ; i++ ) {        var node = pages.childNodes[i];        if (node.nodeType != node.ELEMENT_NODE ||            node.namespaceURI != MICSUM_NS ||            (node.nodeName != "include" && node.nodeName != "exclude"))          continue;        var urlRegexp = node.textContent.replace(/^\s+|\s+$/g, "");        this._rules.push({ type: node.nodeName, regexp: new RegExp(urlRegexp) });      }    }    // allow the generators to set individual update values (even varying    // depending on certain XPath expressions)    var update = getFirstChildByTagName("update", generatorNode);    if (update) {      function _parseInterval(string) {        // convert from minute fractions to milliseconds        // and ensure a minimum value of 1 minute        return Math.round(Math.max(parseFloat(string) || 0, 1) * 60 * 1000);      }      this._unconditionalUpdateInterval =        update.hasAttribute("interval") ?        _parseInterval(update.getAttribute("interval")) : null;      // collect the <condition expression="XPath Expression" interval="time"/> clauses      this._updateIntervals = new Array();      for (i = 0; i < update.childNodes.length; i++) {        node = update.childNodes[i];        if (node.nodeType != node.ELEMENT_NODE || node.namespaceURI != MICSUM_NS ||            node.nodeName != "condition")          continue;        if (!node.getAttribute("expression") || !node.getAttribute("interval")) {          LOG("ignoring incomplete conditional update interval for " + this.uri.spec);          continue;        }        this._updateIntervals.push({          expression: node.getAttribute("expression"),          interval: _parseInterval(node.getAttribute("interval"))        });      }    }    var templateNode = getFirstChildByTagName("template", generatorNode);    if (templateNode) {      this.template = getFirstChildByTagName("transform", templateNode) ||                      getFirstChildByTagName("stylesheet", templateNode);    }    // XXX Make sure the template is a valid XSL transform sheet.    this.loaded = true;  },
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10234/1d776befffac90e7c58d1d211225e34f8e614b12/nsMicrosummaryService.js/clean/browser/components/microsummaries/src/nsMicrosummaryService.js