XSLTProcessor: getParameter() method
DOM
DOM
The `getParameter()` method of the XSLTProcessor interface returns the value of a parameter (`<xsl:param>`) from the stylesheet imported in the processor.
## Syntax
```js-nolint
getParameter(namespaceURI, localName)
```
### Parameters
- `namespaceURI`
- : The namespace associated with the parameter name. A ["null"](/docs/Web/JavaScript/Reference/Operators/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
## Browser compatibility
## See also
- XSLTProcessor.setParameter()
- XSLTProcessor.removeParameter()
- XSLTProcessor.clearParameters()
- XSLTProcessor.reset()
Cite this
"XSLTProcessor: getParameter() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/getParameter JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy