|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-15 06:34 UTC] chregu@php.net
[2008-08-16 02:38 UTC] marc at mongenet dot ch
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 01:00:01 2025 UTC |
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>