使用XPath时,把xml看作节点树。
如下面的例子(摘自w3school):
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
文档节点/根节点:<bookstore>
属性节点:lang="en"
元素节点:<author>J K. Rowling</author>
未完成-------------------------------------------------------