#32712 [Com]: loadXML exits with "Extra content at the end of the document"
| From: | mrc at linuxplatform dot org | Date: | Wed, 11 May 2005 01:29:01 +0000 |
| Subject: | #32712 [Com]: loadXML exits with "Extra content at the end of the document" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78875@lists.php.net to get a copy of this message | ||
ID: 32712
Comment by: mrc at linuxplatform dot org
Reported By: bmuller at milchstrasse dot de
Status: No Feedback
Bug Type: DOM XML related
Operating System: RedHat Linux 2.4.21-4.EL
PHP Version: 5.0.4
New Comment:
For a temp solution, run strval() on your XML buffer.
Previous Comments:
------------------------------------------------------------------------
[2005-04-23 01:00:05] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-04-15 14:16:56] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-04-15 09:23:44] bmuller at milchstrasse dot de
Description:
------------
We develop a contentsystem to access Adobe InCopy Documents out of a
Primebase Database. To read and parse the AIC (Adobe InCopy Document
Format) we use the DOM XML extension. UNfortunatly after reading the
CLOB/BLOB out of the database an loading it via DOM XML
($dom->loadXML($string), PHP throws the warning "Extra content at the
end of the document". Not all the time, but irreguarly. If I read the
the BLOB, write it in a temp textfile and then read it via
$dom->load($filename), everything works fine. I have checked several
times, the data out of the database is _always_ the same amd the XML is
wellformed. Is there a memory leak in the loadXML method?
Reproduce code:
---------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<aic:document xmlns:aic="http://ns.adobe.com/AdobeInCopy/2.0/"
name="Hier steht eine Bildunterschrift für Bildbreite 65" ver="3.0">
<aic:story xml:space="preserve" track="0" dFont="Times"
optalign="0"
optsize="40280000 0"><aic:pstyle name="B_BU"/><aic:cstyle
name="[No
character style]"/>NEU!!!! Hier steht eine Bildunterschrift für
Bildbreite 65,5</aic:story>
</aic:document>
[...]
primebase_cursor_bind($result, 0,PRIMEBASE_BLOB);
while ($line = primebase_fetch_array($result)) {
$aicdocument = primebase_read_blob($line[content]);
$dom = new DOMDocument;
$dom->loadXML($aicdocument); }
echo htmlspecialchars(utf8_decode($dom->saveXML()));
[...]
Expected result:
----------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<aic:document xmlns:aic="http://ns.adobe.com/AdobeInCopy/2.0/"
name="Hier steht eine Bildunterschrift für Bildbreite 65" ver="3.0">
<aic:story xml:space="preserve" track="0" dFont="Times"
optalign="0"
optsize="40280000 0"><aic:pstyle name="B_BU"/><aic:cstyle
name="[No
character style]"/>NEU!!!! Hier steht eine Bildunterschrift für
Bildbreite 65,5</aic:story>
</aic:document>
Actual result:
--------------
Warning: DOMDocument::loadXML() [function.loadXML]: Extra content at
the end of the document in Entity, line: 6 in
/usr/local/dreams/htdocs/k4_table_info.php on line 34
<?xml version="1.0"?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32712&edit=1