Forum und email

XSLT Funktionen

Einführung

Diese PHP Erweiterung stellt eine parserunabhängige API für XSLT-Transformationen zur Verfügung. Momentan unterstützt diese Erweiterung allein die Sablotron Bibliothek von der Ginger Alliance. Die Unterstützung von anderen Bibliotheken wie der Xalan Bibliothek oder der libxslt ist in Planung.

XSLT (Extensible Stylesheet Language (XSL) Transformations) ist eine Sprache zur Transformation von XML Dokumenten in andere XML Dokumente. XLST ist als Standard vom World Wide Web (W3C) Konsortium definiert worden. Informationen zu XSLT und diesbezüglichen Technologien können unter » https://www.w3.org/TR/xslt gefunden werden.

Hinweis: Diese Erweiterung ist anders als die Sablotron Erweiterung wie bei PHP 4.1.0 und früher, momentan wird nur die neue XSLT Erweiterung in PHP 4.1.0 unterstützt. Falls Sie Hilfe zur alten Erweiterung brauchen, fragen sie bitte in der PHP Mailliste nach.

Hinweis: Diese Erweiterung wurde ins » PECL Repositorium verschoben und ist nicht mehr Teil von PHP ab PHP 5.0.0.

Hinweis: Für XSLT Unterstützung in PHP 5 benutzen Sie bitte die XSL Extension.

Anforderungen

Die Erweiterung benutzt Sablotron und expat, beides kann unter » https://www.gingerall.org/sablotron.html gefunden werden. Binäre Dateien werden genauso wie der Quellcode zur Verfügung gestellt.

Installation

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.

Achtung

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

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

Hinweis: Note to Win32 Users In order for this extension to work, there are DLL files that must be available to the Windows system PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the systems PATH), it is not recommended. This extension requires the following files to be in the PATH: sablot.dll, expat.dll, and iconv.dll
For PHP <= 4.2.0, the file iconv.dll is not required.

Laufzeit Konfiguration

Diese Erweiterung definiert keine Konfigurationseinstellungen in der php.ini.

Resource Typen

Diese Extension definiert eine XSLT Prozessor Resource die von xslt_create() zurückgegeben wird.

Vordefinierte Konstanten

Folgende Konstanten werden von dieser Erweiterung definiert und stehen nur zur Verfügung, wenn die Erweiterung entweder statisch in PHP kompiliert oder dynamisch zur Laufzeit geladen wurde.

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.

Inhaltsverzeichnis