PHP 手冊
上一頁 |  | 下一頁

# CXXIV.XSLT Functions

# 介紹

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.

> 備注: This extension is different than the sablotron extension distributed with versions of PHP prior to PHP 4.1, currently only the new XSLT extension in PHP 4.1 is supported. If you need support for the old extension, please ask your questions on the PHP mailing lists.

> 備注: This extension has been removed as of PHP 5 and moved to the PECL repository.

> 備注: 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.com/. Binaries are provided as well as source.

# 安裝

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.

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

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

> Note to Win32 Users: In order to enable this module on a Windows environment, you must copy several files from the DLL folder of the PHP/Win32 binary package to the SYSTEM32 folder of your windows machine. (Ex: `C:\WINNT\SYSTEM32` or `C:\WINDOWS\SYSTEM32`). For PHP <= 4.2.0 copy `sablot.dll` and `expat.dll` to your SYSTEM32 folder. For PHP >= 4.2.1 copy `sablot.dll`, `expat.dll` and `iconv.dll` to your SYSTEM32 folder.

# 執行時期組態

`php.ini`中沒有定義此延伸的組態指令。

# 資源類型

這個延伸沒有定義任何資源。

# 預先定義常數

以下的常數由此延伸定義，只在這個延伸被編譯成PHP或實行時期被動態載入時有效。

`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.

上一頁 | 最開頭 | 下一頁
xsl_xsltprocessor_transform_to_xml | 上一層 | xslt_backend_info