Obtaining Configuration Properties Using XPath

XML Path Language (XPath) is a W3C recommendation as of November, 1999. XPath is a language that describes how to locate and process items in XML documents by using an addressing syntax based on a path through the logical structure or hierarchy of the document. This method enables dynamically routing output based on content in the document. iWay Software supports a range of XPath parameters.

iWay Service Manager (iSM) provides conditional routing through a configuration property. The value of the property is the value returned when the XPath expression is evaluated.

The context node for all iSM XPath statements is the document root (/). iSM calls this the super root, which is the node above the document element.

An iSM XPath statement always returns the value of the selected node. Multiple values are separated by the pipe symbol (|).

If the selected node is an element with no text value, then iSM returns EMPTY. Therefore, selecting the five nodes A B C D E where only C and E have values results in the following:

||value of C||value of E

* by itself selects the document root and returns EMPTY.

The XPATH text() function returns all the text elements of a node. This feature is for document style XML processing, as opposed to data style processing, and is therefore not relevant to iSM.

In iSM, .. is always an error, which means you have gone outside the bounds of the document, and ./ is always the same as /.


Top of page

Example: Using XPath to Dynamically Route Output

The <email> node in the following sample code is referenced by iSM to route a reply-to message:

<customer_profile>
<name>Joseph Bloggs</name>
<email>Joe_Smith@ibi.com</email>
<vehicles>
   <car>JAGUAR</car>
 </vehicles>
</customer_profile>

The XPath notation XPATH(/customer_profile/email) shown in the following image indicates the emitter information derived from the file.


iWay Software