PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_Parser » Bug #2442

Call to "xmltag_ELEMENT_" not correctly managed in function funcEndHandler

Details

Submitted2004-10-04 13:39 UTC
Frommarion dot leclerc at equant dot com
Assignedschst
StatusClosed
PackageXML_Parser
PHP VersionIrrelevant
OSSolaris 2.8
Roadmaps(Not assigned)

Comments

[2004-10-04 13:39 UTC] marion dot leclerc at equant dot com

Description:
------------
XML_parser package 1.2.0
In the function "funcEndHandler", the call to the function "xmltag_ELEMENT_" does not work:

The instruction (line 3):
if (method_exists($this, $func)) {...

Should be:
if (method_exists($this->_handlerObj, $func)) {...

Reproduce code:
---------------
File test.php:
==============
<?php
require_once 'XML/Parser.php';
class TestParser
{
function xmltag_CELLGROUP($xp, $name, $attribs){ echo "START CELLGROUP"; }
function xmltag_CELLGROUP_($xp, $name, $attribs){ echo "END CELLGROUP"; }
}
$p = &new XML_Parser();
$h = &new TestParser();
$p->setHandlerObj( $h );
$result = $p->setInputFile( 'test.xml' ) ;
$p->setMode( 'func' ) ;
$result = $p->parse() ;
?>
File test.xml:
==============
<?xml version="1.0" encoding="ISO-8859-1" ?>
<workbook>
<cellgroup background-color="blue" border="2"></cellgroup>
</workbook>

Expected result:
----------------
When executing the script test.php, I expect to see the 2 messages:

START CELLGROUP (parsing tag <cellgroup>)
END CELLGROUP (parsing tag </cellgroup>)

Actual result:
--------------
Actual result is only:

START CELLGROUP (parsing tag <cellgroup>)