Re: xml_set_element_handler and equivalents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/4/10, Gary wrote:
> I need to do essentially do what can be found in the "XML Tag Mapping
> example" (http://www.php.net/manual/en/example.xml-map-tags.php)
...
> I would prefer to do this in a somewhat OO manner so I can hide this
> nastiness from the rest of the code.
>
> Obviously I can't pass any of my XML handler's to
> xml_set_element_handler as handlers.

Oh. Hum. Of course, I can (where "//..." == elided code):
class Foo {
  //...
  public function bar() {
    //...
    xml_set_element_handler($parser,
                                          array(&$this, "startElement"),
                                          array(&$this, "endElement"));
    //...
  }

  public function startElement($parser, $name, $attrs) {
    //...
  }
}
So just ignore me, I'm having a bad day.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux