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

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getParameter
Chrome – Full support
Chrome 1 (Release date: 2008-12-11)
footnote
footnote Chrome only supports string values.
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote
footnote Edge only supports string values.
Firefox – Full support
Firefox 1 (Release date: 2004-11-09)
footnote Full support
Opera – Full support
Opera 12.1 (Release date: 2012-11-20)
footnote
footnote Opera only supports string values.
Safari – Full support
Safari 3.1 (Release date: 2008-03-18)
footnote
footnote Safari only supports string values.
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote
footnote Chrome Android only supports string values.
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 12.1 (Release date: 2012-10-09)
footnote
footnote Opera only supports string values.
Safari on iOS – Full support
Safari on iOS 2 (Release date: 2008-07-11)
footnote
footnote Safari on iOS only supports string values.
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote
footnote Samsung Internet only supports string values.
WebView Android – Full support
WebView Android 3 (Release date: 2011-02-22)
footnote
footnote WebView only supports string values.
WebView on iOS – Full support
WebView on iOS 2 (Release date: 2008-07-11)
footnote
footnote WebView on iOS only supports string values.

Legend

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

Full support
Full support
See implementation notes.

See also