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 )
- param defines the name of the parameter.
- 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).