PHP. Руководство по PHP. 2005
xslt_set_sax_handlersПред.
xslt_set_sax_handlers
(PHP4 >= 4.0.6, PECL)xslt_set_sax_handlers -- Set the SAX handlers to be called when the XML document gets processed
Description
void xslt_set_sax_handlers (resource processor, array handlers)xslt_set_sax_handlers() registers the SAX handlers for the document, given a XSLT processor resource.
handlers should be an array in the following format:
|
Where the functions follow the syntax described for the scheme handler functions.
Замечание: The given array does not need to contain all of the different sax handler elements (although it can), but it only needs to conform to "handler" => "function" format described above.
Each of the individual SAX handler functions are in the format below:
Using xslt_set_sax_handlers() doesn't look very different than running a SAX parser like xml_parse() on the result of an xslt_process() transformation.
Примеры
You can also use xslt_set_object() if you want to implement your handlers in an object.
Пример 2. Object oriented handler
Both examples will output:
|
xslt_set_sax_handler
xslt_set_scheme_handler