2 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=10419">bug
10419</a>:
3 XSLTProcessor transformToFragment fails because of an XML declaration.
</p>
8 testRunner
.dumpAsText();
11 var xml
= (new DOMParser()).parseFromString('<doc/>', 'application/xml');
12 var xsl
= (new DOMParser()).parseFromString(
13 '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
14 '<xsl:output method="xml" omit-xml-declaration="no"/>' +
15 ' <xsl:template match="doc"><p>1</p><p>2</p></xsl:template>' +
19 var p
= new XSLTProcessor
;
20 p
.importStylesheet(xsl
);
22 var ownerDocument
= document
.implementation
.createDocument("", "doc", null);
23 var f
= p
.transformToFragment(xml
, ownerDocument
);
24 var result
= (new XMLSerializer()).serializeToString(f
);
25 result
= result
.substr(0, 16); // remove the trailing newline, if present
27 if (result
== "<p>1</p><p>2</p>")
28 document
.write('SUCCESS');
30 document
.write('<xmp>FAILURE: "' + result
+ '"</xmp>');
33 document
.write('FAILURE: ' + ex
);