Extended XSLTransformations (EXSLT)  

What is XSLT?

Extensible Stylesheet Language Transformations (XSLT) provides the technology to transform one XML document into another XML document. XSLT offers a standard set of functions for performing various data transformations, but it doesn't have every transformation one needs. A community of developers has created extensions to the standard XSLT function set and is making them available to users on the Web.

Extended Extensible Stylesheet Language Transformations (EXSLT) 

To fulfill the need for additional functionality within XSLT templates, there came a set of valuable extensions to the already existing functionalities in XSLT. These extensions, referred to as  EXSLT, provides a range of functionality across seven modules, which include date functions, string functions, math functions, set functions, and regular expressions.

The EXSLT date functions facilitate creation and manipulation of dates from within our XSLT template. These functions include capabilities such as providing the current date and time, determining if the year is a leap year, and offering day-of-week-in-month.

The string functions offer some more additions to the standard XSLT string functions. We can use the align function to align one string with another, the replace function to replace all occurrences of a particular string within another string, and the tokenize function to break a string into tokens based on specified delimiters.

The math module available in EXSLT provides mostly trigonometric functions. This includes a full array of functions such as sine, cosine, tangent, arcsine, and others. The math package includes some interesting inclusions, such as max and min, which provide the maximum and minimum values in a set, and highest and lowest, which provide the actual node that contains the maximum or minimum value. Other useful functions include a random number generator, square root, and power, which calculates the value of a number raised to a particular power.

The set module includes functions for manipulating sets of data, usually in the form of multiple nodes within an XML document. The difference function determines the set of nodes that are in one set but not in another, and intersection returns only those nodes that are in both sets. The set module also includes functions for finding the set of nodes that precede or trail the first node of a comparison set.

The regular expressions module provides the necessary functions for performing regular expression-based parsing from within XSLT templates. The test function determines if a particular expression evaluates to true or false. The match function performs a similar comparison as test but returns the matched values as a set of nodes. Finally, the replace function performs a regular expression match and replaces the matched values with the specified value.

The XSLT specification isn't comprehensive and, therefore, may not provide a particular function one need. The developers of EXSLT have created extensions to the standard XSLT functions, which provide us with additional functionality.