XPath study notes (a)

What is XPath?

XPath represent mean "XML Path Language", it is a kind of a "path syntax" to identify and find the language XML document nodes.

XPath basic terminology:

1, the nodes (Nodes):

Classification: In XPath, the nodes are divided into seven categories, namely: an element (Element), property (attribute), the text (text), namespace (namespace), processing instruction (processing-instruction), the comment (Comment), and file node (document nodes).

XML document as a tree structure is composed of nodes to process, the top of the tree node is called the root node element (root element node).

Consider the following section of XML code:

<?xml version="1.0" encoding="UTF-8"?>

<bookstore>
  <book>
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
</bookstore> 
< Bookstore > (root element node)
 < author > J K. Rowling </ author > (element node) 
lang = "EN" (node attribute)

 

2, atomic value (Atomic values):

No child nodes father node or nodes. such as:

J K. Rowling
"en"

 

3, items (Items):

Atomic value or a node.

 

References: https://www.w3schools.com/xml/xpath_nodes.asp

Guess you like

Origin www.cnblogs.com/hilovexy-blog/p/11257096.html