|
NodeSet Functions
|
| Function: |
number count(node-set)
|
| Test: |
<xsl:value-of select="count(*)"/>
|
| Desired Result: |
4
|
| Result: |
|
| Function: |
number position()
|
| Test: |
<xsl:value-of select="*[position()=3]"/>
|
| Desired Result: |
z
|
| Result: |
|
| Function: |
number last()
|
| Test: |
<xsl:value-of select="*[last()-1]"/>
|
| Desired Result: |
z
|
| Result: |
|
| Function: |
String local-name(node-set?)
|
| Test: |
<xsl:value-of select="local-name(names/abc:test-name)"/>
|
| Desired Result: |
test-name
|
| Result: |
|
| Function: |
String local-name(node-set?)
|
| Test: |
<xsl:value-of select="local-name()"/>
|
| Desired Result: |
document
|
| Result: |
|
| Function: |
String name(node-set?)
|
| Test: |
<xsl:value-of select="name(names/abc:test-name)"/>
|
| Desired Result: |
abc:test-name
|
| Result: |
|
| Function: |
String namespace-uri(node-set?)
|
| Test: |
<xsl:value-of select="namespace-uri(names/abc:test-name)"/>
|
| Desired Result: |
abc
|
| Result: |
|
|
String Functions
|
| Function: |
string string(object?)
|
| Test: |
<xsl:value-of select="string()"/>
|
| Desired Result: |
x y z
|
| Result: |
|
| Test: |
<xsl:value-of select="string('xyz')"/>
|
| Desired Result: |
xyz
|
| Result: |
|
| Function: |
string concat(string, string, string*)
|
| Test: |
<xsl:value-of select="concat('abc', 'def')"/>
|
| Desired Result: |
abcdef
|
| Result: |
|
| Function: |
boolean contains(string, string)
|
| Test: |
<xsl:value-of select="contains('abcdef', 'efg')"/>
|
| Desired Result: |
false
|
| Result: |
|
| Test: |
<xsl:value-of select="contains('abcdef', 'bcd')"/>
|
| Desired Result: |
true
|
| Result: |
|
| Function: |
boolean starts-with(string, string)
|
| Test: |
<xsl:value-of select="starts-with('abcdef', 'abc')"/>
|
| Desired Result: |
true
|
| Result: |
|
| Test: |
<xsl:value-of select="starts-with('abcdef', 'xyz')"/>
|
| Desired Result: |
false
|
| Result: |
|
| Function: |
number string-length(string?)
|
| Test: |
<xsl:value-of select="string-length(name())"/>
|
| Desired Result: |
8
|
| Result: |
|
| Test: |
<xsl:value-of select="string-length('abcdef')"/>
|
| Desired Result: |
6
|
| Result: |
|
| Function: |
string substring(string, number, number?)
|
| Test: |
<xsl:value-of select="substring('12345', 1.5, 2.6)"/>
|
| Desired Result: |
234
|
| Result: |
|
| Test: |
<xsl:value-of select="substring('12345', 0, 3)"/>
|
| Desired Result: |
12
|
| Result: |
|
| Test: |
<xsl:value-of select="substring('12345', 0 div 0, 3)"/>
|
| Desired Result: |
|
| Result: |
|
| Test: |
<xsl:value-of select="substring('12345', 1, 0 div 0)"/>
|
| Desired Result: |
|
| Result: |
|
| Test: |
<xsl:value-of select="substring('12345', -42, 1 div 0)"/>
|
| Desired Result: |
12345
|
| Result: |
|
| Test: |
<xsl:value-of select="substring('12345', -1 div 0, 1 div 0)"/>
|
| Desired Result: |
|
| Result: |
|
| Function: |
string substring-after(string, string)
|
| Test: |
<xsl:value-of select="substring-after('1999/04/01', '/')"/>
|
| Desired Result: |
04/01
|
| Result: |
|
| Function: |
string substring-before(string, string)
|
| Test: |
<xsl:value-of select="substring-before('1999/04/01', '/')"/>
|
| Desired Result: |
1999
|
| Result: |
|
| Function: |
string translate(string, string, string)
|
| Test: |
<xsl:value-of select="translate('bar', 'abc', 'ABC')"/>
|
| Desired Result: |
BAr
|
| Result: |
|
| Test: |
<xsl:value-of select="translate('---aaa---', 'abc-', 'ABC')"/>
|
| Desired Result: |
AAA
|
| Result: |
|
|
Number Functions
|
| Function: |
number number(object?)
|
| Test: |
<xsl:value-of select="number()"/>
|
| Desired Result: |
NaN
|
| Result: |
|
| Test: |
<xsl:value-of select="number('654.97')"/>
|
| Desired Result: |
654.97
|
| Result: |
|
| Function: |
number round(number)
|
| Test: |
<xsl:value-of select="round(1.75)"/>
|
| Desired Result: |
2
|
| Result: |
|
| Test: |
<xsl:value-of select="round(1.25)"/>
|
| Desired Result: |
1
|
| Result: |
|
| Test: |
<xsl:value-of select="round(-0.5)"/>
|
| Desired Result: |
0
|
| Result: |
|
| Test: |
<xsl:value-of select="round(0.5)"/>
|
| Desired Result: |
1
|
| Result: |
|
| Function: |
number floor(number)
|
| Test: |
<xsl:value-of select="floor(2.2)"/>
|
| Desired Result: |
2
|
| Result: |
|
| Test: |
<xsl:value-of select="floor(-2.2)"/>
|
| Desired Result: |
-3
|
| Result: |
|
| Function: |
number ceiling(number)
|
| Test: |
<xsl:value-of select="ceiling(2.2)"/>
|
| Desired Result: |
3
|
| Result: |
|
| Test: |
<xsl:value-of select="ceiling(-2.2)"/>
|
| Desired Result: |
-2
|
| Result: |
|