General XPath Expressions
So far we’ve focused on the very useful subset of XPath expressions called location paths. Location paths identify a set of nodes in an XML document and are used in XSLT match patterns and select expressions. However, location paths are not the only possible type of XPath expression. XPath expressions can also return numbers, Booleans, and strings. For instance, these are all legal XPath expressions:
3.1415292+2'
Rosalind Franklin'true( )32.5 < 76.2position( )=last( )
XPath expressions that aren’t node-sets can’t be used in the
match attribute of an xsl:template element. However, they can be
used as values for the select
attribute of xsl:value-of elements,
as well as in the location path predicates.