4 https://bugzilla.mozilla.org/show_bug.cgi?id=551412
7 <title>Test for Bug
551412</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=551412">Mozilla Bug
551412</a>
14 <div id=
"content" style=
"display: none"></div>
16 <script type=
"application/javascript">
18 /** Test for Bug
551412 **/
20 var processor = new XSLTProcessor();
22 '
<xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" ' +
23 'xmlns:
exsl=
"http://exslt.org/common" ' +
25 '
<xsl:output method=
"html"/>' +
26 '
<xsl:variable name=
"rtf">1 <b>2</b> 3</xsl:variable>' +
27 '
<xsl:template match=
"/">' +
28 '
<xsl:copy-of select=
"exsl:node-set($rtf)"/>' +
31 var styleDoc = new DOMParser().parseFromString (style,
"text/xml");
35 var originalDoc = new DOMParser().parseFromString(data,
"text/xml");
37 processor.importStylesheet(styleDoc);
39 var fragment = processor.transformToFragment(originalDoc, document);
40 var content = document.getElementById(
"content");
41 content.appendChild(fragment);
42 is(content.innerHTML,
"1 <b>2</b> 3",
43 "Result of transform should be '1 <b>2</b> 3'");