Dear Mirek,

This is how we use the handler for our XML class.
Hope it helps!

class XML
{
function parseXML()
        {
        
/****************************************************************
                Parse string XML data.
        
****************************************************************/
        $parser = xml_parser_create(); 
        xml_set_object($parser, &$this);
        xml_set_element_handler($parser, "start_element",
"stop_element");
        }

function start_element($parser, $name, $attrs) 
        { 
        /***************************************************************
                Handles opening tags
****************************************************************/
        }

function stop_element($parser, $name) 
        { 
        
/****************************************************************
                Handles closing of  tags!
        
****************************************************************/
        }
}

Best regards

Fredrik Davidsson
Alfaproject AB


-----Original Message-----
From: Mirek Novak [mailto:[EMAIL PROTECTED]] 
Sent: den 21 maj 2002 14:52
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [php-objects] XML parser vs objects

Hi,
   is it possible to use methods of a class as a handlers in
xml_set_element_handler(...)? How it can be done?
TIA,
   M.N.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tied to your PC? Cut Loose and
Stay connected with Yahoo! Mobile
http://us.click.yahoo.com/QBCcSD/o1CEAA/sXBHAA/saFolB/TM
---------------------------------------------------------------------~->

Look here for Free PHP Classes of objects:
http://phpclasses.UpperDesign.com/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

 

Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/ 


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

Reply via email to