Saxonica: XSLT and XQuery Processing: setParameter

setParameter

setParameter($namespace as String, $name as String, $value as Object) → Void

Sets named parameters for the XSLT transform

Arguments

 

$namespace

String

The namespace for the parameter name or null

 

$name

String

The parameter name

 

$value

Object

The parameter value

Result

Void

Details

Supplied parameter types may be String, Double, Node or Array. Array items may be any of these types, except Array.

Sample JavaScript code:

            
    ...
    // initialise processor
    var proc = new XSLT20Processor(xsl);
    
    // a node parameter:
    proc.setParameter(null, "fElementArray", document.getElementsByTagName("h2"));
    // a string array parameter
    proc.setParameter(null, "fArray", ["one", "two"]);
    // a string parameter
    proc.setParameter(null, "fString", "my value");
    
    var result = proc.transformToDocument(Saxon.requestXML('data.xml'));

         

Next