Forum und email

XSLT Functions

Introducere

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 » https://www.w3.org/TR/xslt.

Notă: 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.

Notă: Această extensie a fost transferată în repozitoriul » PECL şi nu mai este furnizată împreună cu PHP începând cu versiunea 5.0.0.

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

Necesităţi

This extension uses Sablotron and expat, which can both be found at » https://www.gingerall.org/sablotron.html. Binaries are provided as well as source.

Instalarea

On Unix, run configure with the --enable-xslt --with-xslt-sablot options. The Sablotron library should be installed somewhere your compiler can find it.

Make sure you have the same libraries linked to the Sablotron library as those, which are linked with PHP. The configuration options: --with-expat-dir=DIR --with-iconv-dir=DIR are there to help you specify them. When asking for support, always mention these directives, and whether there are other versions of those libraries installed on your system somewhere. Naturally, provide all the version numbers.

Precauţie

Be sure your Sablot library is linked to -lstdc++ as otherwise your configure will fail, or PHP will fail to run or load.

Notă: JavaScript E-XSLT support If you compiled Sablotron with JavaScript support, you must specify the option: --with-sablot-js=DIR.

Notă: Note to Win32 Users Pentru ca această extensie să funcţioneze, anumite fişiere DLL trebuie să fie accesibile în calea de sistem a Windows din variabila PATH. Accesaţi FAQ întitulat "Cum să adaug directorul meu PHP la variabila PATH din Windows" pentru informaţii despre cum să realizaţi aceasta. Cu toate că copierea fişierelor DLL din directorul PHP în directorul de sistem al Windows de asemenea funcţionează (deoarece directorul de sistem este în mod implicit inclus în variabila PATH), acest lucru nu este recomandabil. Această extensie necesită ca următoarele fişiere să existe în calea PATH: sablot.dll, expat.dll, and iconv.dll
For PHP <= 4.2.0, the file iconv.dll is not required.

Configuraţia la rulare

Această extensie nu are directive de configurare definite în php.ini.

Tipurile resurselor

This extension defines a XSLT processor resource returned by xslt_create().

Constante predefinite

Constantele de mai jos sunt definite de această extensie şi vor fi disponibile doar dacă această extensie a fost compilată în interiorul PHP, sau a fost încărcată dinamic în timpul rulării.

XSLT_OPT_SILENT (integer)
Drop all logging and error reporting. This is a generic option for all backends that may be added in the future.
XSLT_SABOPT_PARSE_PUBLIC_ENTITIES (integer)

Tell Sablotron to parse public entities. By default this has been turned off.

XSLT_SABOPT_DISABLE_ADDING_META (integer)

Do not add the meta tag "Content-Type" for HTML output. The default is set during compilation of Sablotron.

XSLT_SABOPT_DISABLE_STRIPPING (integer)
Suppress the whitespace stripping (on data files only).
XSLT_SABOPT_IGNORE_DOC_NOT_FOUND (integer)
Consider unresolved documents (the document() function) non-lethal.
XSLT_SABOPT_FILES_TO_HANDLER (integer)
XSLT_ERR_UNSUPPORTED_SCHEME (integer)
Error return code, for scheme handlers.

Cuprins