XML handler parameters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yawnmoth

    XML handler parameters

    Some of the parametesr to the xml_set_*_handl er are supposed to be the
    names of "handler" functions that accept certain parameters. For
    example, xml_set_charact er_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? None of the handler functions I've seen make
    any use of it and not all callback functions (as I guess a handler
    function is) require the object that it is supposed to be working on be
    passed to it (array_map, for example)...

  • Andy Hassall

    #2
    Re: XML handler parameters

    On 15 Feb 2006 13:27:34 -0800, "yawnmoth" <terra1024@yaho o.com> wrote:
    [color=blue]
    >Some of the parametesr to the xml_set_*_handl er are supposed to be the
    >names of "handler" functions that accept certain parameters. For
    >example, xml_set_charact er_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?[/color]

    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.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    Working...