xml.XsltTransformer.setParameter

Set parameters in an instance of an XSLTTransformer corresponding to the XSLT entries named by param.

Syntax

xml.XsltTransformer.setParameter(
   param STRING,
   value STRING )
  1. param defines the name of the parameter.
  2. value specifies the value to set the parameter.

Usage

Set parameters corresponding to the XSLT entries named by param.

For example, this XSLT sample contains two param definitions:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  
  <xsl:param name="QADIR" />
  <xsl:param name="NODE_NAME"/>
  ... 
  <MyNode><xsl:value-of select="$QADIR" /></MyNode>
  ...
  <xsl:when test="name()=$NODE_NAME">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
    </xsl:copy>
  </xsl:when>

</xsl:stylesheet>
To set the parameter QADIR:
CALL xslt.setParameter("QADIR","'"||"/work/tmp"||"'") # Literal 
Note:

If a parameter is a literal, you must quote it before calling the setParameter()

To set the parameter NODE_NAME:
CALL xslt.setParameter("NODE_NAME","BOOK")

If the parameter is already set, the previous value will be replaced by the new one.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).