TINYXPATH (转)
来源:互联网 发布:tensorflow for java 编辑:程序博客网 时间:2024/05/16 03:34
TinyXPath examples / regression tests
Input XML tree
<a><b val='123'>
<b />
<c />
<!-- -122.0 -->
<d />
</b>
<!-- 500.0 -->
<x target='xyz'>
sub text </x>
</a>
Results
@val123123//x/text()sub textsub text//*/comment()-122.0-122.0count(//*/comment())22sum(//@*)123123sum(//*/comment())378378true()truetruenot(false())truetruecount(//*[position()=2])22name(/*/*/*[position()=2])ccname(/*/*/*[last()])ddcount(//c/following::*)22count(/a/b/b/following::*)33count(//d/preceding::*)22name(//attribute::*)valvalcount(//b/child::*)33count(//x/ancestor-or-self::*)22count(//b/descendant-or-self::*)44count(//self::*)66count(/a/descendant::*)55count(/a/descendant::x)11count(/a/descendant::b)22count(/a/descendant::b[@val=123])11count(//c/ancestor::a)11name(//d/parent::*)bbcount(//c/ancestor::*)22name(/a/b/ancestor::*)aaname(/a/b/c/following-sibling::*)ddcount(//b/following-sibling::*)33count(//b|//a)33count(//d/preceding-sibling::*)22-3 * 4-12-12-3.1 * 4-12.4-12.412 div 52.42.43 * 72121-5.5 >= -5.5truetrue-5.5 < 3truetrue-6.0 < -7falsefalse12 < 14truetrue12 > 14falsefalse14 <= 14truetrue/a or /btruetrue/c or /bfalsefalse/a and /bfalsefalse/a and /*/btruetrue18-126618+123030count(//a|//b)33count(//*[@val])11name(//*[@val=123])bb3=4falsefalse3!=4truetrue12=12truetrue'here is a string'='here is a string'truetrue'here is a string'!='here is a string'falsefalse/a/b/@val123123count(//*/b)22name(/*/*/*[2])ccname(/*)aaname(/a)aaname(/a/b)bbname(/*/*)bbname(/a/b/c)cccount(/a/b/*)33ceiling(3.5)44concat('first ','second',' third','')first second thirdfirst second thirdceiling(5)55floor(3.5)33floor(5)55string-length('try')33concat(name(/a/b[1]/*[1]),' ',name(/a/b/*[2]))b cb ccount(/a/b/*)33count(//*)66count(//b)22contains('base','as')truetruecontains('base','x')falsefalsenot(contains('base','as'))falsefalsestarts-with('blabla','bla')truetruestarts-with('blebla','bla')falsefalsesubstring('12345',2,3)234234substring('12345',2)23452345substring('12345',2,6)23452345concat('[',normalize-space(' before and after '),']')[before and after][before and after]//*662+3+4+5141420-2-3+52020count(/a/x[1])11name(/a/*[2])xxname(/a/*[1])bbname(/a/x[1])xxcount(/a/b/c[1])11count(/a/b/c[position()=1])11count(/a/b/d[position()=3])00//*[@val]/@val123123//x[text()='sub text']/@targetxyzxyzsubstring('123.4',1)123.4123.4//**syntax errorsyntax errorInput XML tree
<xml><text>
within </text>
</xml>
RSS feed examples
These examples show how to decode a typical XML file : the TinyXPath RSS feedRSS version (XPath expr : /rss/@version) : 2.0
Nb of news messages (XPath expr : count(/rss/channel/item)) : 7
- TINYXPATH (转)
- TinyXML(TinyXPath) 使用总结
- TinyXPath 原来是不支持 XML Namespace 的。
- 对tinyxpath的一些简单优化
- c++使用xpath解析xml --tinyxpath
- 在Linux下使用TinyXPath : tiny C++ XPath
- 【转】
- 转
- 转
- [转]
- 转
- 转
- 转--
- [转]
- 转
- (转)
- 转 >
- 转:
- Java----synchronized的小测试
- 12 13 广播和多播,IGMP协议
- OXygen DirectorySpy delphi版文件监控
- if条件判断中null,0,"",false,undefined的比较
- Stimulsoft报表开发论坛 即将召开
- TINYXPATH (转)
- WTL
- 视图等快捷操作
- Android应用多语言支持实现(方法二)
- 【矩阵乘法入门】给数学不好的人的矩阵乘法模板教程
- android 下添加新按键
- C语言学习(一)概述,数据类型
- 让你提升命令行效率的 Bash 快捷键 [完整版] .
- 怎样写一个解释器