#32712 [NEW]: loadXML exits with "Extra content at the end of the document"
| From: | bmuller at milchstrasse dot de | Date: | Fri, 15 Apr 2005 07:23:46 +0000 |
| Subject: | #32712 [NEW]: loadXML exits with "Extra content at the end of the document" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-77575@lists.php.net to get a copy of this message | ||
From: bmuller at milchstrasse dot de
Operating system: RedHat Linux 2.4.21-4.EL
PHP version: 5.0.4
PHP Bug Type: DOM XML related
Bug description: loadXML exits with "Extra content at the end of the document"
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 bug report at http://bugs.php.net/?id=32712&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32712&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32712&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32712&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32712&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32712&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32712&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32712&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32712&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32712&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32712&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32712&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32712&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32712&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32712&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32712&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32712&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32712&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32712&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32712&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32712&r=mysqlcfg