XML_Parser::reset()
| From: | Stephan Schmidt | Date: | Wed, 20 Aug 2003 20:44:30 +0000 |
| Subject: | XML_Parser::reset() | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-20178@lists.php.net to get a copy of this message | ||
Hi,
I've a question concerning the XML_Parser package:
I'd like to parse more that one file with one instance of XML_Parser.
Currently I have to call $this->xmlParser(); which will create a new
parser, but this also calls the PEAR constructor, which is not
necessary. If I do not call the constructor I get: "Error: XML_Parser:
junk after document element at XML input line 99". Wouldn't it be nice
to have some kind of reset() method that allows you to parse another
document?
Furthermore xml_parser_free() is only called in case of an error.
Otherwise, the resource is kept until the end of the script. There even
isn't a destructor in this class that frees the parser.
I didn't file this as a bug report, as it's no real bug, but something
that could (and should) be improved. I'm willing to do the improvements,
if you are interested.
Best regards,
Stephan