EXSLT - Functions

Implementer Page: func.html
Module Package: func.zip


The functions available in XPath cover only basic functionality. While a stylesheet author can often use XSLT code to achieve a goal, it would often be simpler to use a function instead. It's impossible to predict all the functions authors might need, and it also adds portability to a stylesheet if authors can write their own functions (as long as the function implementations are understood by the XSLT processor). These could be defined in any language, but the one language that XSLT processors can all understand is XSLT, so it makes sense to define functions using XSLT instructions. However, XSLT as it stands cannot support the return of values other than result tree fragments; to write functions that return node sets and so on, we need an extension element.




The namespace for EXSLT - Functions is:


Throughout this document, the prefix func is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions).


<xsl:stylesheet version="1.0"

<xsl:import href="func.xsl" />



Core Elements

The following extension elements are considered stable and are core to EXSLT - Functions. Processors that claim support of EXSLT - Functions support these elements.

   name = QName>
   <-- Content: (xsl:param* | template) -->
   select = expression>
   <-- Content: template -->

Other Elements

The following extension elements are not considered stable and are not part of the core of EXSLT - Functions. Processors that claim support of EXSLT - Functions might not support these elements.

   implements-prefix = ncname
   language = qname-and-not-ncname
   src = uri-reference
   archive = uri-reference />

http://www.exslt.org/func/index.html last modified 2001-05-22