- XPath has a set of standard functions that can be used in XPath expressions
- If they have arguments, these are separated by commas
- Their main use is in predicates
Test whether the substring in the current element's content, starting at character #5 and
having two characters, can be converted to the number 25:
<xsl:if test="number(substring(.,5,2)) = 25">
- The 25 XPath function are extended by XSLT 1.0 to make 36 in total
- conversions (eg, number())
- string manipulation (eg, concat())
- arithmetic (eg, floor(), sum())
- getting node and identifier names (eg, lang())
- boolean (eg, not())
- context information (eg, last())
- Some were described last week. Implementations can extend the basic set of functions
such as Saxon and MSXSL functions to convert Result Tree Fragments back into Nodesets.