XPath in MDW

XPath is used in many places in MDW to match messages with certain patterns and to extract data out of XML documents. The standard XPath language, however, is rather cumbersome to use when name spaces are involved, as you must declare all name spaces as part of the XPath expression.

MDW implements name space agnostic XPath language. So far the language supports a subset of the standard XPath language.

Examples of valid MDW XPath expressions include:

   /Book/Chapter/Section
   Book/Chapter[@title='The World is Flat']
   //Order/*[OrderType='N']
   /Order/@id
The following table summarizes the syntax:
*Matches any element name
//Recursive Descent
@attribute_nameMatches attribute of the given name
@*Matches any attribute name
[@attribute_name='value']Attribute value filter
[child_tag_name='value']Child value filter
The double quotes can be used in place of single quote. When the value contains only letters and digits, the quotes can be left out (e.g. /Order[OrderType="N"] or /Order[OrderType=N]).

The initial slash is optional when the expression is applied to an entire document, which is the case most of times.