Name

XSLTProcessor.transformToFragment( ): transform a node or document to a DocumentFragment

Synopsis

DocumentFragment transformToFragment(NodesourceNode,
                                     Document ownerDocument)

Arguments

source

The document or node that is to be transformed.

owner

The document through which the returned DocumentFragment is created. The ownerDocument property of the returned DocumentFragment refers to this document.

Returns

A DocumentFragment object that holds the result of the transformation.

Description

This method performs an XSLT transformation on the specified node, returning the result as a DocumentFragment object. The transformation uses the XSLT stylesheet specified by importStylesheet( ) and the parameter values specified with setParameter. The returned fragment can be inserted into the specified owner document.

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.