// }}}
// {{{ php4 constructor
- /**
- * Creates an XML parser.
- *
- * This is needed for PHP4 compatibility, it will
- * call the constructor, when a new instance is created.
- *
- * @param string $srcenc source charset encoding, use NULL (default) to use
- * whatever the document specifies
- * @param string $mode how this parser object should work, "event" for
- * startelement/endelement-type events, "func"
- * to have it call functions named after elements
- * @param string $tgtenc a valid target encoding
- */
- function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null)
- {
- XML_Parser::__construct($srcenc, $mode, $tgtenc);
- }
+
// }}}
// {{{ php5 constructor
*/
function _initHandlers()
{
- if (!is_resource($this->parser)) {
+ if (!is_object($this->parser)) {
return false;
}
return $result;
}
// if $this->fp was fopened previously
+
if (is_resource($this->fp)) {
while ($data = fread($this->fp, 4096)) {
if (!$this->_parseString($data, feof($this->fp))) {
- $error = &$this->raiseError();
+ $error = $this->raiseError();
$this->free();
return $error;
}
**/
function free()
{
- if (isset($this->parser) && is_resource($this->parser)) {
- xml_parser_free($this->parser);
+ if (isset($this->parser) && is_object($this->parser)) {
+ //xml_parser_free($this->parser);
unset( $this->parser );
}
if (isset($this->fp) && is_resource($this->fp)) {
* @return null
* @abstract
*/
- function startHandler($xp, $elem, &$attribs)
+ function startHandler($xp, $elem, $attribs)
{
return null;
}
* @return null
* @abstract
*/
- function endHandler($xp, $elem)
+ function endHandler( $elem)
{
return null;
}