W3cubDocs

/Web APIs

XSLTProcessor: transformToFragment() method

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

Syntax

js

transformToFragment(source)

Parameters

source

The Node source to apply the XSLT stylesheet to.

Return value

Examples

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
transformToFragment
1Chrome returns null if an error occurs.
12Edge returns null if an error occurs.
1Firefox throws an exception if an error occurs.
No
≤12.1["Opera 12.1 and earlier throws an exception if an error occurs.", "Opera 15 and later returns null if an error occurs."]
3.1Safari returns null if an error occurs.
3WebView returns null if an error occurs.
18Chrome returns null if an error occurs.
4Firefox throws an exception if an error occurs.
≤12.1["Opera Android 12.1 and earlier throws an exception if an error occurs.", "Opera Android 14 and later returns null if an error occurs."]
2Safari returns null if an error occurs.
1.0Samsung Internet returns null if an error occurs.

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/transformToFragment