2 "This test checks whether XSLTProcessor.transformToFragment() does not crash when the target document does not have a root node."
5 var xml = (new DOMParser()).parseFromString('<doc/>', 'application/xml');
6 var xsl = (new DOMParser()).parseFromString(
7 '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">' +
8 '<xsl:output method="xml" omit-xml-declaration="yes"/>' +
9 ' <xsl:template match="doc">SUCCESS</xsl:template>' +
13 var p = new XSLTProcessor;
14 p.importStylesheet(xsl);
15 var ownerDocument = document.implementation.createDocument("", "", null);
16 var f = p.transformToFragment(xml, ownerDocument);
18 // Firefox throws an exception here, while WebKit doesn't:
19 // "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces."
20 ownerDocument = document.implementation.createDocument("", null, null);
21 f = p.transformToFragment(xml, ownerDocument);
23 var successfullyParsed = true;