rem: this.template = templateNode.getElementsByTagNameNS(XSLT_NS, "transform")[0] || templateNode.getElementsByTagNameNS(XSLT_NS, "stylesheet")[0]; 
add: this.template = getFirstChildByTagName("transform", templateNode) || getFirstChildByTagName("stylesheet", templateNode); 
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];    // XXX We should throw instead of returning if the file doesn't contain    // a generator.    if (!generatorNode)      return;    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    }    // 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 = generatorNode.getElementsByTagNameNS(MICSUM_NS, "pages")[0];    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 = generatorNode.getElementsByTagNameNS(MICSUM_NS, "update")[0] || null;    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 = generatorNode.getElementsByTagNameNS(MICSUM_NS, "template")[0];    if (templateNode) {      this.template = templateNode.getElementsByTagNameNS(XSLT_NS, "transform")[0]                      || templateNode.getElementsByTagNameNS(XSLT_NS, "stylesheet")[0];    }      // XXX Make sure the template is a valid XSL transform sheet.    this.loaded = true;  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/019053083eabc975a3c9b079989d61c9da69b6bb/nsMicrosummaryService.js/buggy/browser/components/microsummaries/src/nsMicrosummaryService.js