Discussion on xPath related knowledge
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.