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.
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 |
- 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:
and<?xml-stylesheet type="text/xsl" href="me.xsl"?<
"me.xsl"
is then used as the name of the style sheet. - 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.
- 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 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.
- 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.
- 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.
- 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.
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.