1 <html xmlns=
"http://www.w3.org/1999/xhtml" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
6 <p>Test importing an xsl:stylesheet node as stylesheet for XSLTProcessor.
</p>
7 <xsl:stylesheet version=
"1.0">
9 <xsl:template match=
"/">
11 <p><xsl:apply-templates/></p>
15 <xsl:template match=
"para">
16 <xsl:value-of select=
"."/>
22 if (window
.testRunner
)
23 testRunner
.dumpAsText();
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
));
36 document
.body
.appendChild(document
.createTextNode(ex
));