XSLT Functions
Introdução
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.
Nota: 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.
Nota: Esta extensão foi movida para o repositório » PECL e não é mais distribuida em conjunto com o PHP a partir do PHP 5.0.0.
Nota: If you need xslt support with PHP 5 you can use the XSL extension.
Dependências
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.
Instalação
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.
Nota: JavaScript E-XSLT support If you compiled Sablotron with JavaScript support, you must specify the option: --with-sablot-js=DIR.
Nota: Note to Win32 Users Para esta extensão funcionar, existem arquivos DLL que devem estar disponíveis no PATH do sistema Windows. Veja o FAQ entitulado "Como eu adiciono o meu diretório PHP no PATH no Windows" para informações de como fazer isto. Mesmo que copiar os arquivos DLL da pasta do PHP no diretório system do Windows também funcione (porque o diretório system está por padrão no PATH do sistema), isso não é recomendado. Esta extensão requer que os seguintes arquivos estejam no PATH: sablot.dll, expat.dll, and iconv.dll
For PHP <= 4.2.0, the file iconv.dll is not required.
Configurações em execução
Esta extensão não define nenhum parâmetro de configuração no php.ini.
Tipos Resource
This extension defines a XSLT processor resource returned by xslt_create().
Constantes pré-definidas
As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução.
- 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.
Índice
- xslt_backend_info — Returns the information on the compilation settings of the backend
- xslt_backend_name — Returns the name of the backend
- xslt_backend_version — Returns the version number of Sablotron
- xslt_create — Create a new XSLT processor
- xslt_errno — Returns an error number
- xslt_error — Returns an error string
- xslt_free — Free XSLT processor
- xslt_getopt — Get options on a given xsl processor
- xslt_process — Perform an XSLT transformation
- xslt_set_base — Set the base URI for all XSLT transformations
- xslt_set_encoding — Set the encoding for the parsing of XML documents
- xslt_set_error_handler — Set an error handler for a XSLT processor
- xslt_set_log — Set the log file to write log messages to
- xslt_set_object — Sets the object in which to resolve callback functions
- xslt_set_sax_handler — Set SAX handlers for a XSLT processor
- xslt_set_sax_handlers — Set the SAX handlers to be called when the XML document gets processed
- xslt_set_scheme_handler — Set Scheme handlers for a XSLT processor
- xslt_set_scheme_handlers — Set the scheme handlers for the XSLT processor
- xslt_setopt — Set options on a given xsl processor