Extensions to XSLT 1.0 (EXSLT 1.0) - Common

This version:
    exslt-common-010310.html
Most Recent version:
    http://www.jenitennison.com/xslt/exslt/common/
Previous versions:
    exslt-common-010302.html
    exslt-common-010302.html
    exslt-common-010225.html
Author: Jeni Tennison

Abstract

This document describes the common set of EXSLT 1.0. EXSLT 1.0 is a set of extension elements and functions that XSLT authors may find helpful when creating stylesheets. The common set of EXSLT 1.0 are those extension elements and functions that provide a base level of common functionality that the rest of EXSLT can build on.

Other parts of EXSLT 1.0 include:

Status of this Document

This document is a fourth draft for review by the implementers of XSLT processors and the XSLT stylesheet authors. It is based on discussions on XSL-List. Comments on this document should be sent to XSL-List.

This document has no official standing and has not been considered nor approved by any organization.

Contents

1. Introduction
2. Namespace
3. Common Functions

Appendices

A. References
B. Acknowledgements
C. Changes from previous version

1. Introduction

This document describes the common set of EXSLT 1.0. EXSLT 1.0 is a set of extension elements and functions that XSLT authors may find helpful when creating stylesheets. The common set of EXSLT 1.0 are those extension elements and functions that provide a base level of common functionality that the rest of EXSLT can build on.

The extension elements and functions defined within this document are governed by the general rules about extensions to XSLT covered in [14. Extensions] in [XSLT 1.0].

XSLT processors are free to support any number of the extension elements and functions described in this document. However, an XSLT processor must not claim to support EXSLT 1.0 - Common unless all the extensions described within this document are implemented by the processor. An implementation of an extension element or function in an EXSLT namespace must conform to the behaviour described in this document.

2. Namespace

The namespace for the extension elements and functions described in this document is:

http://xmlns.opentechnology.org/xslt-extensions/common
      

Throughout this document, the prefix exsl 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).

3. Common Functions

This section defines the common extension functions in EXSLT 1.0.

Function: node-set exsl:node-set(object)

The purpose of the exsl:node-set function is to convert a result tree fragment into a node set. If the argument is a node set already, it is simply returned as is. It is an error if the argument to exsl:node-set is not a node set or a result tree fragment.

Function: string exsl:object-type(object)

The exsl:object-type function returns a string giving the type of the object passed as the argument. The possible object types are: 'string', 'number', 'boolean', 'node-set' or 'RTF'.

Most XSLT object types can be coerced to each other without error. However, there are certain coercions that raise errors, most importantly treating anything other than a node set as a node set. Authors of utilities such as named templates or user-defined extension functions may wish to give some flexibility in the parameter and argument values that are accepted by the utility; the exsl:object-type function enables them to do so.

A. References

XSLT
World Wide Web Consortium. XSL Transformations (XSLT). W3C Recommendation. See http://www.w3.org/TR/xslt
XPath
World Wide Web Consortium. XML Path Language. W3C Recommendation. See http://www.w3.org/TR/xpath

B. Acknowledgements

This has been informed and inspired by discussions on XSL-List with:

David Carlisle
Jarno Elovirta
Joe English
Clark C. Evans
Jim Fuller
Dave Gomboc
Dave Hartnoll
Kevin Jones
Yevgeniy (Eugene) Kaganovich
Mike Kay
Steve Muench
Miloslav Nic
Francis Norton
Dimitre Novatchev
Uche Ogbuji
David Rosenborg

C. Changes from Previous Version