cvs: pear /XML_Parser Parser.php
| From: | Stephan Schmidt | Date: | Mon, 17 Jan 2005 19:06:18 +0000 |
| Subject: | cvs: pear /XML_Parser Parser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-28632@lists.php.net to get a copy of this message | ||
schst Mon Jan 17 14:06:18 2005 EDT
Modified files:
/pear/XML_Parser Parser.php
Log:
fixed a bug that occured when using 'func' mode and setHandlerObj()
added default handlers for 'func' mode
http://cvs.php.net/diff.php/pear/XML_Parser/Parser.php?r1=1.20&r2=1.21&ty=u
Index: pear/XML_Parser/Parser.php
diff -u pear/XML_Parser/Parser.php:1.20 pear/XML_Parser/Parser.php:1.21
--- pear/XML_Parser/Parser.php:1.20 Wed Dec 22 04:55:03 2004
+++ pear/XML_Parser/Parser.php Mon Jan 17 14:06:13 2005
@@ -18,7 +18,7 @@
// | Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Parser.php,v 1.20 2004/12/22 09:55:03 schst Exp $
+// $Id: Parser.php,v 1.21 2005/01/17 19:06:13 schst Exp $
/**
* XML Parser class.
@@ -271,8 +271,8 @@
switch ($this->mode) {
case 'func':
- xml_set_object($this->parser, $this);
- xml_set_element_handler($this->parser, 'funcStartHandler',
'funcEndHandler');
+ xml_set_object($this->parser, $this->_handlerObj);
+ xml_set_element_handler($this->parser, array(&$this,
'funcStartHandler'), array(&$this, 'funcEndHandler'));
break;
case 'event':
@@ -581,6 +581,8 @@
$func = 'xmltag_' . $elem;
if (method_exists($this->_handlerObj, $func)) {
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem, $attribs);
+ } elseif (method_exists($this->_handlerObj, 'xmltag')) {
+ call_user_func(array(&$this->_handlerObj, 'xmltag'), $xp, $elem,
$attribs);
}
}
@@ -592,6 +594,8 @@
$func = 'xmltag_' . $elem . '_';
if (method_exists($this->_handlerObj, $func)) {
call_user_func(array(&$this->_handlerObj, $func), $xp, $elem);
+ } elseif (method_exists($this->_handlerObj, 'xmltag_')) {
+ call_user_func(array(&$this->_handlerObj, 'xmltag_'), $xp, $elem,
$attribs);
}
}