Posted by Andy Hassall on 02/15/06 23:36
On 15 Feb 2006 13:27:34 -0800, "yawnmoth" <terra1024@yahoo.com> wrote:
>Some of the parametesr to the xml_set_*_handler are supposed to be the
>names of "handler" functions that accept certain parameters. For
>example, xml_set_character_data_handler's handler function is supposed
>to take two parameters - parser and data.
>
>My question is... what purpose does passing the parser object to the
>handler function serve?
Probably so in theory you can have multiple parse operations running all using
the same callback functions, but routing data into different places using the
parser object to differentiate between instances?
Although it's probably neater to just use an object method callback to do this
instead of a global function callback, and I'd guess having multiple parse
operations on the go at the same time in a PHP script is rare enough anyway.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|