Oxxus » Tutorials » PHP turorial » Using Sablotron XSLT

PHP tutorial

Using Sablotron XSLT

Sablotron XSLT Overview

Sablotron is a fast, compact and portable XML toolkit implementing XSLT 1.0, DOM Level2 and XPath 1.0.

Sablotron is an open project and is subject to the Mozilla Public License or the General Public License alternatively.

Project is founded to create a lightweight, reliable and fast XML library processor conforming to the W3C specification, which is available for public and can be used as a base for multi-platform XML applications.

Sablotron sources and binaries for selected platforms are available for download at the http://www.gingerall.org/downloads.html.


Sablotron requires James Clark's http://sourceforge.net/projects/expat XML parser.

Encoding issues are solved using the iconv library (a part of GNU C Library) which is a standard part of Linux and many Unix systems.

On Windows OS based paltforms it must be installed prior to Sablotron installation (to enable code-page conversions).

To enable JavaScript extensions, the http://www.mozilla.org/js/ engine by http://www.mozilla.org/ is required.

The Sablotron extensions can be implemented within the PHP as well during the PHP compilation from the source.

This PHP extension provides a processor independent API to XSLT transformations. Currently this extension only supports the Sablotron library from the Ginger Alliance.

Support is planned for other libraries, such as the Xalan library or the libxslt library.

XSLT (Extensible Stylesheet Language (XSL) Transformations) is a language for transforming XML documents into other XML documents.

It is a standard defined by The World Wide Web Consortium (W3C). Information about XSLT and related technologies can be found at http://www.w3.org/TR/xslt.

Note: This extension is different than the sablotron extension distributed with versions of PHP prior to PHP 4.1.0, currently only the new XSLT extension in PHP 4.1.0 is supported.

If you need support for the old extension, please ask your questions on the PHP mailing lists.

Note: This extension has been moved to the PECL repository and is no longer bundled with PHP as of PHP 5.0.0.

Note: If you need xslt support with PHP 5 you can use the XSL extension.


This extension uses Sablotron™ and expat™, which can both be found at http://www.gingerall.org/sablotron.html.

Binaries are provided as well as source.

After installing php4-xslt and sablotron, you may have to add this line to php.ini :

Contact sales!