Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Discussion on xPath related knowledge

Shulou Source: shulou.com Published: 2022-06-03 05:34:23 11月24日 Update

The role of xPath is to select the path of the node in the xml file.

(1) the convention of path expression

"/" indicates a partial separator within the path

There are two ways to write the same node: absolute path and relative path

Absolute paths must start with "/", while relative paths must not start with "/"

"." Represents the current node

".." Represents the parent node of the current node

(2) basic rules for selecting nodes

Nodename: indicates that all child nodes are selected

/: indicates that the root node is selected

/ /: means to select a node at any location

@: indicates that an attribute is selected

(3) predicate condition

These are the additional conditions added to the path expression, all of which are added to [] to indicate further filtering of the node.

Tags: Node path selection condition beginning expression position function writing delimiter that is attribute file parent rule predicate advance convention attachment knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL NVidia Redmi Shulou Tech Info macOS