您的位置:首页 > 其它

XSLT 运算符 和 记录一些用过的语句

2007-10-17 09:12 169 查看


输入您的搜索字词 提交搜索表单
google_ad_client = "pub-5033576919944123";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-10-24: csdn.blog
google_ad_channel = "8548491739";

1、运算符与特殊字符

/ 选择子元素,返回左侧元素的直接子元素;如果“/”位于最左侧表示选择根结点的直接子元素
// 递归下降,不论深度,搜索指定的元素;如果位于最左侧表示从根结点出发递归下降搜索指定元素
. 表示当前元素
* 通配符,选择任意元素,不考虑名字
@ 取得属性值,作为属性名的前缀
@* 通配符,选择任意属性,不考虑名字
: 名字作用范围分隔符,将名字作用范围前缀与元素或属性名分隔开来
!* 在相关节点上应用指定方法
()* 分组,明确指定优先顺序
[] 应用过滤样式
[]* 下标运算符,用于在集合中指示元素
2、逻辑运算符(比较运算符)
比较运算符 可选样式 描述
and $and$或&& 逻辑与
or $or$或|| 逻辑或
not() $not$ 逻辑非
3、关系运算符
= $eq$ 相等
= $ieq$ 相等(不区分大小写)
!= $ne$ 不等
$ine$ 不等(不区分大小写)
< $lt$ 小于
$ilt$ 小于(不区分大小写)
< = $le$ 小于等于
$ile$ 小于等于(不区分大小写)
> $gt$ 大于
$igt$ 大于(不区分大小写)
>= $ge$ 大于等于
$ige$ 大于等于(不区分大小写)
$all$ 集合运算符,如果集合中所有项目均满足条件则返回“真”
$any$ 集合运算符,如果集合中任意项目满足条件则返回“真”
| 集合运算符,返回两个集合的联合

Record ":

<xsl:param name="start" />
<xsl:variable name="middle" select="$start + 2" />
<xsl:variable name="total" select="count(//product)" />

<xsl:variable name="toprange" select="/products/product[position() >= $start and position() <= $middle]" />
<xsl:variable name="bottomrange" select="/products/product[position() >= $middlePlusOne and position() <= $end]" />

<xsl:variable name="templastBegin" select="$total div 6" />
<xsl:variable name="templastEnd" select="$total mod 2" />
<xsl:variable name="lastBegin" select="substring($templastBegin,1,1) * 6 + 1" />

<xsl:variable name="src">
<xsl:value-of select="Image" />
</xsl:attribute>

google_ad_client = "pub-5033576919944123";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-10-24: csdn.blog
google_ad_channel = "8548491739";
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: