XML SET XSL-PARAMETERS

This statement has the following parameter:

Description

Parameter

Description

Parameter list

Literals or identifiers of data items, which comprise a list containing at least one name/value pair to be used whenever transform operations are performed. Names in the list must be nonnumeric and must correspond to parameters specified in the XSLT stylesheet to have any effect. Values in the list can be numeric or nonnumeric.

The XML SET XSL-PARAMETERS statement passes a list of name/value pairs to XML Extensions, where they are stored until one of the following occurs:

  • They are replaced by a subsequent execution of an XML SET XSL-PARAMETERS statement.
  • They are cleared by executing an XML CLEAR XSL-PARAMETERS statement.
  • They are cleared by flushing the cache (the statements XML INITIALIZE, XML ENABLE CACHE, XML DISABLE CACHE, XML FLUSH CACHE, and XML TERMINATE all clear the cache).
  • The COBOL run-unit terminates.

The saved parameters are used whenever any of the following transform operations occur:

  • The XML TRANSFORM FILE or XML TRANSFORM TEXT statement is executed.
  • The XML EXPORT FILE, XML EXPORT TEXT, XML IMPORT FILE, or XML IMPORT TEXT statements reference an optional stylesheet.

A maximum of 20 name/value pairs may be specified. If more than 20 pairs are specified or the parameters are not specified as pairs, an error will be reported.

Note: In JVM COBOL code, the name/value arguments are restricted to alphanumeric (PIC X) data items or literals. To use numeric, numeric literal (as in the example below), or other data item types use the XML SET XSL-PARAMETERS-NEW statement instead. See JVM COBOL Code Considerations for more information.

Example

XML SET XSL-PARAMETERS
 "MY-COUNT", 7.
IF NOT XML-OK GO TO Z.