XSLTProcessor: transformToDocument() method

The transformToDocument() method of the XSLTProcessor interface transforms the provided Node source to a Document using the XSLT stylesheet associated with XSLTProcessor.

Syntax

js
transformToDocument(source)

Parameters

source

The Node source to apply the XSLT stylesheet to.

Return value

A Document. The actual interface depends on the output method of the stylesheet:

Output method Result interface
html HTMLDocument
xml XMLDocument
text XMLDocument with a single root element <transformiix:result> with the text as a child

Examples

Specifications

Specification
DOM Standard
# dom-xsltprocessor-transformtodocument

Browser compatibility

BCD tables only load in the browser

See also