Building Expressions in the Editor Workspace Text Fields

The XQuery Expression Editor, the XQuery Condition Editor, and the XPath Expression Editor all provide text fields in which you can build expressions by typing directly or by pasting items from the palettes.

Before you begin

These instructions assume you are creating or editing an expression in the XQuery Expression Editor, XQuery Condition Editor, or XPath Expression Editor, as described in Creating and Editing Inline XQuery and XPath Expressions.

To build an expression in a text field:

  1. Display the panel containing the text field. Depending on the editor, do one of the following:
    • In the XQuery Expression Editor, select XQuery Text (located under the workspace button bar), if it is not already selected.
    • In the XQuery Condition Editor, select Text (located under the workspace button bar), if it is not already selected.
    • In the XPath Expression Editor, you do not have to select anything, because there are no options for selecting other tools.
    • Note: Selecting any of the above links displays a text field where you can create a complete expression appropriate for the context. However, the tools and techniques described in this topic can be used wherever text fields are provided in the editors, for example when binding variables from imported resources to the inline expression, as described in Binding External XQuery Resources to Inline XQueries and Binding External XSLT Resources to Inline XQueries.
  2. If desired, type or paste an expression or expression fragment into the field. If you create the complete expression this way, skip to step 7, below. Otherwise, proceed to the next step.
  3. Select the palette containing the item(s) you want to add to the expression, and locate the item you want to add, as described in Table 20-1, below.
  4. Table 20-1 Palettes 
    Palette
    Description and Use
    Namespace Definitions
    Lists default AquaLogic Service Bus namespaces, variable namespaces, and user-defined namespaces. Namespace abbreviations are listed when defined.
    Scroll through the lists to find the desired namespace.
    You can also define a namespace. See Creating Namespaces to Use in Inline Expressions.
    XQuery Functions
    Contains a set of standard XQuery functions, organized alphabetically and by type:
    • Service Bus Functions
    • Accessors
    • Error Functions
    • XML Functions
    • Constructors
    • Numerics
    • Strings
    • URIs
    • Booleans
    • Durations, Dates, and Times
    • QNames
    • Nodes
    • Sequences
    • Context Functions
    • Alphabetical
    Expand or collapse nodes in the tree by clicking the plus sign (+) or minus sign (-).
    See also:
    Variable Structures
    Displays variables and their contents as trees, which can help you to visualize.
    To display a variable structure and its contents
    • Select the name of the structure from the drop-down list at the top of the palette. The list displays Built-in message context variables (attachments, body, header, outbound, and inbound), as well as any user-defined structures, organized by type (XML Type, Service Interface, and Simple Type).
    • Expand or collapse nodes in the tree by clicking the plus sign (+) or minus sign (-).
    You can also define your own variable structures. See Creating Variable Structures in the XQuery Editors.
    Variable structures do not create variables. Variables are created at runtime as the target of the Assign action in the stage.
    When you insert an item from the a variable structure tree into the text field, it is inserted as an XPath expression that describes the path.

  5. Paste the desired item into the text field using any of the methods shown below in Table 20-2:
  6. Table 20-2 Ways to Paste Items Into the Editor Text Fields 
    From this palette...
    Do this...
    Namespace Definitions palette
    Use standard mouse or keyboard select, copy, and paste a namespace, for example:
    1. Select the entire namespace string (or its abbreviation, if one exists) by dragging the mouse pointer over the string.
    2. Press Ctrl-C to copy the string.
    3. Click the location in the text field where you want to insert the namespace.
    4. Press Ctrl-V to paste the string.
    XQuery Functions palette or Variable Structures palette
    Drag an item from the palette to the text field.
    Note: Dragging from the palette to the workspace is supported only in Internet Explorer.
    XQuery Functions palette or Variable Structures palette
    1. Click an item in the palette. The item is displayed in the Property Inspector pane:
      • Functions are displayed with placeholders for any values you have to supply.
      • Variables and their attributes are displayed as XPath expressions.
    2. Click in the text field where you want to insert the item
    3. Click Copy Property to paste the item into the location selected in the text field.
    XQuery Functions palette or Variable Structures palette
    1. Click an item in the palette. The item is displayed in the Property Inspector pane.
    2. Select and copy the item in the Property Inspector, using standard keyboard or mouse actions.
    3. Select a location in the text field, and paste the item into the text field, using standard keyboard or mouse actions.

  7. Continue to drag and drop functions to build the desired expression.
  8. Edit the expression in the text field, as needed.
  9. Optionally, do either or both of the following:
    • Click Validate. A message is displayed if the expression is validated successfully.
    • Click Test to test the expression. See Performing XQuery Testing.
  10. Click Save to close the editor and insert the expression in the action.

After you finish

Continue configuring the action, as described in Adding and Editing Actions in Message Flows.