Variable node


When you are working in the TrueSight Orchestration Development Studio XSLT transform editor, the Variable node is used to define a value for a global or a local variable. 

When the Variable node is placed as a child node of a Template node, it defines a local variable. A global variable is defined when the Variable node is placed in the top level of the style sheet.

Variables are used in conjunction with the Copy of node. A variable is specified in the Select field of the Copy of Property Panel as _$<name>_ where _<name>_ is the value defined in the Name field of a Variable node.

Field

Description

Required

Name

Variable name for which a value will be defined.

This value must be a qualified name (Qname), beginning with a letter, colon or underscore and consisting of alphanumeric characters, underscores or dashes.

Yes

 

Select

The XPath expression used to define the variable's value.

Yes

XPath Helpers

(Groups / Functions)

The XPath helpers, Groups and Functions, are used to facilitate the formation of basic XPath statements.

NA

Variable node example

These variable node examples illustrate variable node usage while applying transformation to an input XML.

Local variable example

In the following transform example, two local variables are used to add notes to an incoming collection of work orders and change requests.

The change-notes variable adds, "This is local change note." The workorder-notes variable adds, "This is a workorder note."

The XML output appears in the Preview Drawer on the right.

LocalVariableNode.png

Global variable example

The following transform searches work orders for a default template ID value (a value assigned to template-id). If a default template ID is found, it is used in the XML output. If no default template ID is found, the value Global template ID is used for the template ID.

The XML output appears in the Preview Drawer on the right.

GlobalVariableNode.PNG

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*