XPath Expression Builder

The XPath Expression Builder makes creating XPath expressions to use in your business process models more convenient. Function and token menus enable you to select the functions and tokens to build an expression.

Note: This topic assumes familiarity with XML Path language (XPath). If you need more information about XPath, see the World Wide Web Consortium at www.w3c.org and the Business Process Modeling Language (BPML) documentation.

The following figure shows the XPath Expression Builder. For more information, see Defining and Assigning Rules and Conditions under Managing Business Processes.

The Expression Builder provides descriptive information to help you make your choices:
  • When you mouse over a function or token, pop-up help describes the selection.
  • Function selections are comprised of two parts. The first part, in italics, is descriptive of the function. The second part, in bold text, is the actual code for the XPath function you are selecting. For example, the number last ( ) function selection indicates that the last function returns a number.

The following figure shows a pop-up description and indicates the parts of a function selection:

The XPath Expression Builder supports several function types and token sets. To build XPath expressions, you must be familiar with the expression type you need and understand the functions and tokens used in the expression types. For descriptions of XPath function types and tokens, view the XPath Tutorial at http://www.w3c.org.

Remember that you cannot use functions and tokens in Sterling B2B Integratorthat are not supported in the XPath Expression Builder, with the following exceptions:
  • DocToDOM
  • DOMToDoc

    For information about these exceptions, see the BPML documentation.

The following table describes the function types supported by the XPath Expression Builder:

Function type Description
Node-Set Used to obtain information from an XML document, such as counting purchase orders in a node set. Also:
  • Defines a set of sequential context-nodes
  • Specifies what information to process or return for the set of context-nodes
String Perform basic string operations, such as:
  • Finding the length of a string
  • Comparing a string
  • Changing letters from uppercase to lowercase
  • Modifying the text content of XML elements or attributes
  • Converting an argument of any type
Boolean Specifies a Boolean argument (using either the true or false state) that can include predicates and return the result.
Number Manipulate numbers, such as:
  • Specifying a numeric function for adding groups of numbers
  • Finding the nearest integer to a number
  • Performing basic arithmetic operations

The following table describes the three token sets supported by the XPath Expression Builder:

Token Set Use to:
Axis Define the direction of your search by using keywords, including:
  • Attributes
  • Child elements (default)
  • Descendants of the child elements
  • Parent elements
  • Ancestor elements
Node Test Indicate the name of the node for which to search.
Note: Insert the name of the node test after the resolution operator (::) that follows the axis.
Predicate Insert a relational operator to test each node in the set of context-nodes of a location path.
Note: Predicates can use Boolean operators.