Functions, operators, and data types for XPath 2.0
I have made the following changes to the function library:
- The
count()
andsum()
functions now ork on any sequence, and new functionsavg()
,min()
, andmax()
are provided. - Added
ends-with()
- Added
upper-case()
andlower-case()
. These use the rules defined by the Java default locale - Added properties "product-name" and "product-version" to
system-property()
- Changed
key()
so that the second argument can be any sequence; each member of the sequence is converted to a string and treated as a potential key value - Changed
document()
so that the first argument can be any sequence; each member of the sequence can be a URI of a document to be loaded. - The
node-set()
function in the EXSLT common module is now a no-op; the object-type() function returns one of "sequence", "boolean", "number", "string", or "external". - Changed
highest()
andlowest()
in the EXSLTmath
module to work on arbitrary sequences. - Added
exists()
andempty()
,insert()
andremove()
,index-of()
andsublist()
. - Added
not3()
(three-valued not() function) - Added
string-pad()
function - Removed
saxon:exists()
andsaxon:for-all()
: these are superseded by thesome
andevery
constructs in XPath 2.0 - Added the
compare()
function: the third argument (collation) is initially mandatory, and must be a QName matching asaxon:collation
element - Added
base-uri()
function replacing the undocumentedsaxon:base-uri()
extension function - Added constructor functions as described in the XPath Functions and Operators specification:
some of them don't do much yet, but
float()
is the only way of creating a single-precision floating point number.
Significant Omissions
In general, features of XSLT 2.0 and XPath 2.0 not listed above have not been implemented. In particular, these include:
- Backwards compatibility mode in XSLT
- The
type
attribute ofxsl:variable
, etc. - Uniform handling of the empty sequence by functions and operators in XPath expressions
- XPath constructs related to types, for example
instance of
andcast as
.