xslt中的运算
粗略看了下xslt,做了点笔记:
1.字符串函数:contain('Welcome','e'):字符串包含,包含:true,不包含:false
concat('Welcome ', Name, '!'):字符连接
substring-before(string, pattern)
substring-after(string, pattern)
tarts-with(string, pattern)
substring(string, i, len?)
string-length(string)
translate(string, from-pattern, to-pattern)
大小写转换:translate(“Hello”, “ABCDEFGHIJKLMNOPQRSTUVWXYZ”,
“abcdefghijklmnopqrstuvwxyz”);
2.布尔运算:< > = <= >= !=
< > = <= >= !=
3.算术运算:+, -, *, div, mod
算术函数:sum(node set) this function sums up all the values in the set of nodes
floor(number) returns the largest integer that is not greater than number
Example. floor(2.5) returns 2
ceiling(number) returns the smallest integer that is not less than number
Example. Ceiling(2.5) returns 3
round(number) returns the integer closest to number
Example. round(2.3) returns 2