RE: [PEAR-DEV] Problems with Config - which leads to problems with XML_Parse
| From: | Lukas Smith | Date: | Tue, 19 Aug 2003 13:08:16 +0000 |
| Subject: | RE: [PEAR-DEV] Problems with Config - which leads to problems with XML_Parse | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20048@lists.php.net to get a copy of this message | ||
> From: Stephan Wentz [mailto:wentz@gmx.de]
> Sent: Tuesday, August 19, 2003 3:05 PM
>
> > Stephan,
> >
> > as far as I understand the situation: Could you please verify if
it's
> > a problem in XML_Parser or in the PHP-function xml_parse? If it's in
> > PHP we should urgently file a bug there since they are in the
> > (hopefully last) RC4 for a new php-release.
> >
> > If the bug is in XML_Parse and you could send me a xml-file and
small
> > (!) script where the problem occurs I'll have a look at it.
> >
> > Stefan
> >
>
> Yepp, just verifying it... It's really strange, i tried the
example-code
> from http://de3.php.net/manual/en/ref.xml.php with the same
> xml-file
and
> it works, i set the block-size to 2048 like in XML_Parse... no
problems
> at all. But it looks like XML_Parse uses just the same functions as
the
> examples. This is really weird...
I think the problem is in the Config container.
When you are reading in chunks you need to append the cdata to the value
you are storing. When a cdata is split up into two chunks the cdata
handler is called twice.
Please have a look at the Parser.php in the current MDB release for
details (it is not in cvs anymore). I have pasted the relevant part
here:
function cdataHandler($xp, $data)
{
if ($this->var_mode == TRUE) {
if (!isset($this->variables[$data])) {
$this->raiseError('variable "'.$data.'" not found',
$xp);
return;
};
$data = $this->variables[$data];
};
switch($this->element) {
/* Initialization */
case 'database-table-initialization-insert-field-name':
@$this->init_name .= $data;
notice the last line: @$this->init_name .= $data;
Regards,
Lukas