EXSLT - System

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

EXSLT - System provides features for using the host system.

This module defines an additional namespace, http://exsl.org/system/environment, through which a user can access system environment variables via the system-property function.

Use this namespace as follows. Given SQ, a string that is a QName with a prefix that maps to http://exsl.org/system/environment and local part L, system-property(SQ) returns the value of the system environment variable L. For example, if "env" maps to this namespace, then system-property("env:USER") might return "john". If the system uses case-insensitive environment variable names, then the implementation SHOULD match L to the system's environment variable names in a case-insensitive manner and it SHOULD document the systems on which this behavior takes place. For example, on a case-insensitive system the previous function call would match USER, user, and User environment variable names, among others.

The result of a call to system-property("env:X") MUST always return the same value (for a given X) throughout the processing session. Which environment variables are available to a given XSLT transformation is system- and implementation-dependent, and an implementation SHOULD document any special steps it takes when exposing environment variables. Whenever an implementation cannot provide a value for a given environment variable, it MUST return the zero-length string as the result of the system-property call. The mapping of the encoding of the variable's original value to that of the XPath string object is implementation-dependent.

Note: Retrieving environment variables can pose a security risk if those environment variables expose sensitive system information.

XSLT processors may support any number of the extension elements and functions given in this module.

Using EXSLT will only make your stylesheet portable amongst the implementations that support EXSLT. Note that there is no requirement for XSLT processors that are compliant to XSLT to support the extensions described within EXSLT.

Namespace

The namespace for EXSLT - System is:

http://exslt.org/system

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

To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:sys="http://exslt.org/system"
                extension-element-prefixes="sys">

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

...
              
</xsl:stylesheet>

http://www.exslt.org/sys/index.html last modified 2006-02-15