Using local environment variables to set properties

The XSLTransform node supports a number of local environment message tree variables, which you can use to dynamically alter the values that are set in the node's properties.

The following table lists each local environment variable against the name of the node property that it overrides:
Local environment variable name Node property name
XSL.StyleSheetName Stylesheet name
XSL.MessageDomain Message domain
XSL.MessageSet Message model
XSL.MessageType Message
XSL.MessageFormat Physical format
XSL.OutputCharSet Character set
This node searches for the name of the style sheet to be used by interrogating, in the following order:
  1. The input message.
    The node searches the message XML data for information about the location of the style sheet. For example, the XML data might contain:
    <?xml-stylesheet type="text/xsl" href="me.xsl"?<
    and "me.xsl" is then used as the name of the style sheet.
  2. The local environment.

    If no style sheet name is found in the input message, the node searches the local environment that is associated with the current message for style sheet information stored in an element called XSL.StyleSheetName.

    This node was available in a previous version, and element ComIbmXslXmltStylesheetname was used for the name of the style sheet, therefore the current node checks both elements. If both are present, the value in XSL.StyleSheetName takes precedence.

  3. The node properties.

    If no style sheet name is found in the input message or local environment, the node uses the Stylesheet name and Stylesheet directory properties to determine the correct values.

The node searches for the message domain, message model, message type, and message format to use for the output message by interrogating, in the following order:
  1. The local environment.

    The node searches the local environment that is associated with the current message for message domain, message model, message type, and message format information stored in elements called XSL.MessageDomain, XSL.MessageSet, XSL.MessageType, and XSL.MessageFormat.

  2. The node's properties.

    If no message domain, message model, message type, or message format information is found in these local environment variables, the node uses the Message domain, Message model, Message, and Physical format properties to determine the correct values.

If the node cannot determine the message domain from either XSL.MessageDomain or the Message domain property, the default value of BLOB is used. No default values exist for message model, message type, and message format.
The node searches for the character set to use for the output message by interrogating, in the following order:
  1. The local environment.

    The node searches the local environment that is associated with the current message for character set information stored in an element called XSL.OutputCharSet; for example, to encode the output of the transformation as UTF-8, enter the value 1208 as a string in this element.

    This node was available in a previous version, and element ComIbmXslXmltOutputcharset was used for the output character set, therefore the current node checks both elements. If both are present, the value in XSL.OutputCharSet takes precedence.

  2. The node's properties.

    If no character set information is found in the local environment, the node uses the Character set property to determine the correct value.

    If you set a value for Character set, the value that you enter must be numeric; for example, to encode the output of the transformation as UTF-16, enter 1200.

If the node cannot determine the output character set from either of these two sources, because either no value is set or the selection priorities are set to zero, the default value of 1208 (UTF-8) is used.

Be aware of the following factors if the input to the XSLTransform node is generated from the XMLNSC parser or the MRM parser. The XMLNSC parser discards certain information in XML documents, such as processing instructions and comments, if you do not set properties to retain this information in a preceding node. To ensure that the XSLTransform node transforms the message correctly, set the Retain mixed content, Retain comments, and Retain processing instructions properties correctly on the preceding node (for example, an MQInput node). The MRM parser also discards this information, but you cannot retain information for this parser, therefore avoid using the MRM domain if such information is vital to your transformation.