XPath Expressions and Example Values

The following table lists typical XPath expressions and provides an example for each expression.

XPath Expression

Meaning

Example

Caption

Caption from CI

PRD server 01

./Caption

Caption from CI

PRD server 01

/Caption

Caption of the root (database) CIs

PRD

../../Caption

Selects the caption from the parent of the parent CI

PRD

../RelationType

Selects the parent relation type

container_f

../../OMType

Selects the parent of the parent type

ACME_System

/OMType

Selects type of the root CI

ACME_System

//.[type=’WINOSSPI: Infrastructure’]/Caption

Selects the caption of all CIs of type WINOSSPI: Infrastructure

BLANTONS: Infrastructure

//Dependencies[type=’hosted_on’]/CI/Caption

Selects the caption of all CIs with a hosted_on dependency

BLANTONS

//Dependencies/CI/Caption

Selects the caption of all CIs that have dependencies

BLANTONS

Note If the Xpath expression selects a node below the starting database node, the “..” reads back one step. The following expression reads down to the node db and then links back to the starting database node.

//dependencies[type='hosted_on']/CI/../..

However, if the node db is the starting node, the expression ../.. follows the containment links of the node db, which is not the dependency relation that is shown in this example. The result depends on the parent container of the node, which is a different hierarchy.