How to Add Global Variables

Global variables can be used in both Map View and XSLT View.

To create a global variable:

  1. Right-click any node in the source pane and select Add Global Variable from the context menu. Alternatively, click the Add icon, identified by the green plus sign in the XSLT toolbar and select Add Global Variable. This option is also available on the canvas context menu under the Create option.

    The Variable dialog appears.

  2. Enter a name for the variable, and an optional namespace and prefix if desired.
  3. Click OK.

    The variable node appears at the top of the XSLT pane or target pane depending on whether you are using the XSLT View or Map View.

    The variable also appears in the source tree within the Variables folder. This enables you to map from the variable to XPath expressions or nodes in the target tree.

    Note:

    You cannot define a structure for the variable in the current release. If the variable you are referencing represents a complex structure, you can reference nodes within the structure by entering the appropriate XPath expression manually.