In this section: |
In this section: |
How to: |
XPath is a language that is mainly used to address parts of an XML document based on a path through the logical structure or hierarchy of the document. In Designer, XPath defines the path to the value or values in an XML document to use for a property or parameter. In Designer, XPath always starts from the root of the document.
Note: The XPath syntax used in Designer is based on a subset of the XPATH 1.0 specification, found at http://www.w3.org/TR/xpath.html.
The default axis is "child". Currently, this is the only axis available in Designer.
iIT Designer uses XPath in conjunction with iWay Service Manager.
Important: All iWay functions are available in iIT Designer. and can be used in conjunction with XPath statements. For more information on iWay functions, see the iWay Service Manager User’s Guide.
XPath populates values with data from Service Manager in one of three ways:
The following are examples of location path parameters that use abbreviated syntax taken from section 2.5 of the XPath specification. This specification is found at http://www.w3.org/TR/xpath.html#path-abbrev.
Selects the para element children of the current position.
Selects all element children of the current position.
Selects all text node children of the current position.
Selects the name attribute of the current position.
Selects the first para child of the current position.
Selects the last para child of the current position.
Selects all para grandchildren of the context node.
Selects the para element descendants of the root element.
Selects all the user descendants of the document root.
Selects all the item elements that have an olist parent.
Selects the current position.
Selects the para element descendants of the current position.
Selects the parent of the current position.
Selects the lang attribute of the parent of the current position.
Selects all para children of the context node that have a type attribute with value warning.
Selects the fifth para child of the current position that has a type attribute with value warning.
Selects the fifth para child of the context node if that child has a type attribute with value warning.
Selects the chapter children of the current position that have one or more title children with string-value equal to Introduction.
Selects the chapter children of the current position that have one or more title children.
Designer provides the XPath Builder tool as an easy method to construct XPath statements that can then be used in object definitions. This section explains how to build XPath statements with XPATH Builder.
The Designer XPATH Builder tool guides you through the process of creating an XPath statement. The major steps are:
To use XPATH Builder:
The XPATH Builder - Load a document instance dialog box opens, as shown in the following image.
The Select an XML file dialog box appears.
The XML file appears in the display pane of XPATH Builder.
The Build an XPath dialog box opens, as shown in the following image. Double click the element, attribute or attribute value you wish include in the statement.
The item appears in the XPath Expression field. The following image is an example of this dialog box with count selected in the center pane and the related expression appearing in the XPath Expression field. The values and occurrences of this element appear in the Description pane, in the bottom of the dialog box.
The results appear on the top of the XPath builder dialog box.
The XPath statement is now available from the various object parameter selections.
|
iWay Software |