XPath Capability

The XPath capability indicates that a device can use XPath expressions as filter criteria in the <filter> element, and the <get> and <get-config> operations can query specified data through an XPath.

XPath — XML Path Language — uses path expressions for the addressing of parts of an XML file. The XPath syntax is similar to the file path in the file management system.

XPath syntax specifications are as follows:
  • An XPath can only be an absolute path, and steps are separated using slashes (/), for example, /acl:acl/acl:groups/acl:group.
  • Only predicates in the [node name='value'] format (for example, [genre='Computer']) are supported. There can be multiple predicates, which are in an AND relationship.
  • XPath supports multiple namespaces, which are separated using colons.

If an XPath expression is used as a filter criterion, the value of the type attribute in the <filter> element is xpath, and the value of the select attribute (which must exist) is the XPath expression.

<filter type="xpath" xmlns:acl="urn:huawei:yang:huawei-acl" select="/acl:acl/acl:groups/acl:group[acl:identity='2000']"/>

XPath expressions cannot be used as filter criteria for such operations as notifications, full synchronization, incremental synchronization, or copy-config.

XPath expressions support the following operations:

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >