XSLTProcessor: getParameter() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The getParameter() method of the XSLTProcessor interface returns the value of a parameter (<xsl:param>) from the stylesheet imported in the processor.

Syntax

js
getParameter(namespaceURI, localName)

Parameters

namespaceURI

The namespace associated with the parameter name. A "null" value is treated the same as the empty string ("").

localName

The name of the parameter in the associated namespace.

Return value

An object that is the value associated with the parameter. It can be of any type.

Note: Firefox supports any kind of parameter. Chrome, Edge and Safari only support string parameters.

Examples

Using getParameter()

This example shows how to use getParameter() to check the value of a parameter that controls the behavior of an XSLT transformation.

js
const xsltProcessor = new XSLTProcessor();
xsltProcessor.setParameter(null, "foo", "bar");
console.log(xsltProcessor.getParameter(null, "foo")); // "bar"

Specifications

Specification
DOM
# dom-xsltprocessor-getparameter

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getParameter

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.

See also