note 8799 added to XML parser functions
| From: | sam at cwa dot co dot nz | Date: | Thu, 28 Sep 2000 11:39:06 +0000 |
| Subject: | note 8799 added to XML parser functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5540@lists.php.net to get a copy of this message | ||
I've discovered some unusual behaviour in this API when ampersand entities are parsed in cdata;
for some reason the parser breaks up the section around the entities, and calls the handler repeated
times for each of the sections. If you don't allow for this oddity and you are trying to put
the cdata into a variable, only the last part will be stored.
You can get around this with a line like:
$foo .= $cdata;
If the handler is called several times from the same tag, it will append them, rather than rewriting
the variable each time. If the entire cdata section is returned, it doesn't matter.
May happen for other entities, but I haven't investigated.
Took me a while to figure out what was happening; hope this saves someone else the trouble.
http://www.php.net/manual/ref.xml.php