addParameter Method [Visual Basic]
Adds parameters into an XSL Transformations (XSLT) style sheet.
[Script]
Script Syntax
objXSLProcessor.addParameter(baseName, parameter, namespaceURI);
Parameters
baseName
The name that will be used inside the style sheet to identify the parameter context.
parameter
A number, Boolean, string, IXMLDOMNodeList, or IXMLDOMNode. Passing in a single node will produce a node list that contains one node (shortcut).
namespaceURI (optional)
An optional namespace.
Example
var xslt = new ActiveXObject("Msxml2.XSLTemplate");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.addParameter("param1", "Hello");
xslProc.transform();
alert(xslProc.output);
File Name: Sample.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:param name="param1"/>
<xsl:template match="/">
The parameter value was: <xsl:value-of select="$param1"/>
</xsl:template>
</xsl:stylesheet>