|
(PHP 4 >= 4.0.6, PECL)
xslt_set_sax_handlers -- Set the SAX handlers to be called when the XML document gets processedxslt_set_sax_handlers() registers the SAX handlers for the document, given a XSLT processor resource.
handlers should be an array in the following format:
<?php |
Anmerkung: 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:
start_doc ( resource processor )
end_doc ( resource processor )
start_element ( resource processor, string name, array attributes )
end_element ( resource processor, string name )
start_namespace ( resource processor, string prefix, string uri )
end_namespace ( resource processor, string prefix )
comment ( resource processor, string contents )
pi ( resource processor, string target, string contents )
characters ( resource processor, string contents )
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.
Beispiel 2. Object oriented handler
Both examples will output:
|
Zurück | Zum Anfang | Weiter |
xslt_set_sax_handler | Nach oben | xslt_set_scheme_handler |
Hosting by: Hurra Communications GmbH
Generated: 2007-01-26 17:57:24