ID: 45824
Updated by: [EMAIL PROTECTED]
Reported By: marc at mongenet dot ch
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: Linux
PHP Version: 5.2.6
New Comment:
You should read the warning, it produces:
Warning: DOMDocument::loadXML(): Entity 'eacute' not defined in Entity,
line: 2 in /Users/chregu/tmp/foo.php on line 6
eacute is not a entity which is defined by default (there are only 5 of
them)
Previous Comments:
------------------------------------------------------------------------
[2008-08-14 17:59:11] marc at mongenet dot ch
Description:
------------
When an attribute value contains an entity reference (like
a="é"), loadXML() moves this entity out of the attribute, just
before the owner element.
Reproduce code:
---------------
$doc = new DOMDocument();
$xml = '<!DOCTYPE e PUBLIC "1" "2">'."\n". # DOCTYPE just to appear
well-formed
'<e><e a="é"/></e>'."\n";
$doc->loadXML($xml);
echo '<pre>', htmlspecialchars($doc->saveXML()), '</pre>';
Expected result:
----------------
<?xml version="1.0"?>
<!DOCTYPE e PUBLIC "1" "2">
<e><e a="é"/></e>
Actual result:
--------------
<?xml version="1.0"?>
<!DOCTYPE e PUBLIC "1" "2">
<e>é<e a=""/></e>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45824&edit=1