Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xsl / import-non-document-node.xhtml
blob622fb597db347665ab445df12a52cadc05908981
1 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
2 <head>
3 <title/>
4 </head>
5 <body>
6 <p>Test importing an xsl:stylesheet node as stylesheet for XSLTProcessor.</p>
7 <xsl:stylesheet version="1.0">
9 <xsl:template match="/">
10 <html>
11 <p><xsl:apply-templates/></p>
12 </html>
13 </xsl:template>
15 <xsl:template match="para">
16 <xsl:value-of select="."/>
17 </xsl:template>
18 </xsl:stylesheet>
20 <para>SUCCESS</para>
21 <script>
22 if (window.testRunner)
23 testRunner.dumpAsText();
25 try {
26 var stylesheetElement = document.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "stylesheet")[0];
27 var paraElement = document.getElementsByTagName("para")[0];
28 var proc = new XSLTProcessor;
29 proc.importStylesheet(stylesheetElement);
30 var transformationResult = proc.transformToDocument(paraElement);
31 document.body.removeChild(stylesheetElement);
32 document.body.removeChild(paraElement);
34 document.body.appendChild(document.adoptNode(transformationResult.firstChild));
35 } catch (ex) {
36 document.body.appendChild(document.createTextNode(ex));
38 </script>
39 </body>
40 </html>