XSLT专业站 - 提供xslt和xml相关的资料书籍和教程  
XSLT专业站 - 提供xslt和xml相关的资料书籍和教程
网站地图  收藏本站
首页 | 热门文章 | 精彩实例 | 经典教程 | XSLT语法详解 | 资料下载 | 休闲天地 | 交流论坛
  当前位置:首页>热门文章>XPath>文章内容
XPath 运算符
来源:XSLT.org.cn 作者:XSLT专业站 发布时间:2007-08-04  
XPath 运算符

XPath表达式可返回节点集、字符串、逻辑值以及数字。

XPath 运算符

下面列出了可用在XPath表达式中的运算符:

运算符 描述 实例 返回值
| 计算两个节点集 //book | //cd 返回所有带有book和ck元素的节点集
+ 加法 6 + 4 10
- 减法 6 - 4 2
* 乘法 6 * 4 24
div 除法 8 div 4 2
= 等于 price=9.80 如果price是9.80,返回值为true 如果price是9.90,返回值为fasle
!= 不等于 price!=9.80 如果price是9.90,返回值为true 如果price是9.98,返回值为fasle
< 小于 price<9.80 如果price是9.00,返回值为true 如果price是9.98,返回值为fasle
<= 小于或等于 price<=9.80 如果price是9.00,返回值为true 如果price是9.90,返回值为fasle
> 大于 price>9.80 true if price is 9.90 false if price is 9.80
>= 大于或等于 price>=9.80 true if price is 9.90 false if price is 9.70
or price=9.80 or price=9.70 true if price is 9.80 false if price is 9.50
and price>9.00 and price<9.90 true if price is 9.80 false if price is 8.50
mod 计算除法的余数 5 mod 2 1


标题: XPath 运算符
关键字:XPath 运算符
上一篇:XPath Axes(坐标轴)   下一篇:XPath 实例
  XPath热点文章
·XPath 语法
·XPath 简介
·XPath 节点
·XPath Axes(坐标轴)
·XPath 实例
  XPath相关文章
·XPath Axes(坐标轴)
·XPath 实例
·XPath 语法
·XPath 节点
·XPath 简介
Copyright© 2007 xslt.org.cn All rights reserved.