ITPub博客

首页 > Linux操作系统 > Linux操作系统 > XPATH的简单例子

XPATH的简单例子

原创 Linux操作系统 作者:mouqj 时间:2007-09-01 17:27:20 0 删除 编辑
基本的XPATH语法类似于FILE协议
对于XML文件test.xml









The basic XPath syntax is similar to filesystem addressing. If the path starts with the slash / , then it represents an absolute path to the required element.
/AAA
Select the root element AAA

<AAA> <BBB/>
<CCC/>
<BBB/>
<BBB/>
<DDD>
<BBB/>
DDD>
<CCC/>
AAA>
Open the example in XLab. | Tree view (JPG)
/AAA/CCC
Select all elements CCC which are children of the root element AAA

<AAA>
<BBB/>
<CCC/> <BBB/>
<BBB/>
<DDD>
<BBB/>
DDD>
<CCC/>
AAA>
Open the example in XLab. | Tree view (JPG)
/AAA/DDD/BBB
Select all elements BBB which are children of DDD which are children of the root element AAA

<AAA>
<BBB/>
<CCC/>
<BBB/>
<BBB/>
<DDD>
<BBB/> DDD>
<CCC/>
AAA>
[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11049438/viewspace-967501/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle分页
请登录后发表评论 登录
全部评论
  • 博文量
    33
  • 访问量
    122953