XSLT Statements
Using the XSLT statement you can set up the transformation of mapping.
The following sections describe the XSLT statements you can add to your mapping. You can add or edit these statements by clicking the
Edit Statement
icon (XPath 1.0) or
Show/Hide Edit Tab
icon (XPath 2.0) , or these statements can be added automatically by selecting them from the dialogs that appear when you drag and drop elements from the Scope Variables tree to the function argument tree.
The following sections discuss statement types (available in the Statement Type drop-down list in the Edit Statement dialog).
- Attribute
Allows you to specify an attribute, and optionally the namespace for the attribute. You can also specify the type of value for the attribute. - Choose
Provides a way to select transformation to perform based on an expression. Specify the condition in the when element as an XPath expression. You can optionally specify an otherwise condition for processing all elements that do not meet any of the specified when conditions. - Comment
Places a comment in the XSLT template. Comments are delimited by <!-- and -->. - Copy
Copies the selected node to the current node in the input tree. Only the node is copied, no children of the node are copied. - Copy-Contents-Of
Copies the selected node’s contents. This is useful if you wish to copy an element to a new element with a different name. - Copy-Of
Creates a copy of the selected node, including the node’s children. Both the copied node and the destination node must have the same name and structure. - Element
Creates an element with the specified name. - For-Each
Performs the specified statements once for each item in the selected node. This is useful if you wish to process each item of a repeating element once. - For-Each-Group
Groups the items in a list by a specified element. This statement requires a Grouping statement to specify which element to group-by. - Generate Comment
Places a comment element into the XSLT template. This comment will be generated into the function’s output. - Generate PI
Places a processing instruction into the XSLT template. - If
An if statement is used to surround other statements in an XSLT template to perform conditional processing. If the test attribute evaluates to true, the statements in the if are output, otherwise they are not output. - Value-Of
Specifies a value-of statement. This is normally done implicitly by specifying the formula for an element (field) in the mapping, but you may insert this statement explicitly. - Variable
Adds a local variable for use in the current mapping. You can specify the name of the variable and whether you wish the variable to have a select attribute.
Copyright © TIBCO Software Inc. All rights reserved.