note 58819 deleted from ref.xml by bjori
| From: | bjori@php.net | Date: | Mon, 09 Oct 2006 11:07:20 +0000 |
| Subject: | note 58819 deleted from ref.xml by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118269@lists.php.net to get a copy of this message | ||
Note Submitter: Felix dot Riesterer at gmx dot net
----
adrian_popescu at yahoo dot com is right when he states, that Raphael's XMLParser Class (which
I began to love!) has a flaw with content of multiple lines. I ran into trouble with entities,
because Raphael's class would cut off everything before the last entity plus the entity itself
leaving only the rest string.
I found out that the "dataHandler" function needs to be repaired. Adrian's mending by
use of the ".=" operator is not enough. If $this->data[$index]['content']
isn't set yet you might run into error messages. So check it first! Here's my
modification:
<?php
// You need the complete XML Parser Class by Raphael
// as this is only a part of it
function dataHandler($parser, $data)
{
if($data = trim($data))
{
$index = count($this->data) -1;
if(isset($this->data[$index]['content']))
$this->data[$index]['content'] .= $data;
else $this->data[$index]['content'] = $data;
}
}
?>