4 https://bugzilla.mozilla.org/show_bug.cgi?id=440974
7 <title>Test for Bug
440974</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=440974">Mozilla Bug
440974</a>
14 <div id=
"content" style=
"display: none">
18 <script class=
"testbody" type=
"text/javascript">
20 /** Test for Bug
440974 **/
22 function isTxResult(node)
24 return node.namespaceURI ==
"http://www.mozilla.org/TransforMiix" &&
25 node.localName ==
"result";
30 xmldoc = new DOMParser().parseFromString('
<items><item><id>1</id></item><item><id>2</id></item><item><id>3</id></item></items>',
"text/xml");
31 xsltdoc = new DOMParser().parseFromString('
<xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">\n\
32 <xsl:output method=
"xml" />\n\
33 <xsl:template match=
"item"><foo id=
"{id}"/></xsl:template>\n\
34 </xsl:stylesheet>',
"text/xml");
36 var processor = new XSLTProcessor;
37 processor.importStylesheet(xsltdoc);
38 var result = processor.transformToDocument(xmldoc);
39 var resultElements = Array.prototype.filter.call(result.getElementsByTagName('*'), isTxResult);
40 is(resultElements.length,
1,
"there should be only one 'transformiix:result' element");
41 is(resultElements[
0], result.documentElement,
"the 'transformiix:result' element should be the document element");