#37878 [Asn->Bgs]: Dom Automatically Replaces ASCII Entities Regardless of substituteEntities

From: Date: Fri, 23 Jun 2006 02:38:56 +0000
Subject: #37878 [Asn->Bgs]: Dom Automatically Replaces ASCII Entities Regardless of substituteEntities
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98697@lists.php.net to get a copy of this message
ID: 37878 Updated by: rrichards@php.net Reported By: brandenrauch at gmail dot com -Status: Assigned +Status: Bogus Bug Type: DOM XML related Operating System: XP PHP Version: 5.1.4 Assigned To: rrichards New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Behavior is corret - These are pre-defined entities and substituteEntities has no effect on the behavior of them. See the specs for more info: http://www.w3.org/TR/2004/REC-xml-20040204/#sec-predefined-ent Previous Comments: ------------------------------------------------------------------------ [2006-06-22 19:32:06] tony2001@php.net Assigned to the maintainer. ------------------------------------------------------------------------ [2006-06-21 20:11:06] brandenrauch at gmail dot com Description: ------------ For my project my data is passing through both xml and xsl. I've chosen to use decimal (ascII) entities--ex: &#34;--0for input such as quotes ("), singles quotes ('), less thans (<), greater thans(>), and ampersands (&). However, when I load my xml into dom it automatically transforms these characters into either their natural ascII form (specifically quotes), or an html entity. These transformations are made regardless of the substituteEntities boolean setting in the DOMDocument object. Reproduce code: --------------- $text = '<xml><text>&#60;tag&#62;</text><text>&#34;quotes&#34;</text></xml>'; $dom = new DOMDocument(); $dom->substituteEntities = false; $dom->loadXML($text); echo $dom->saveHTML(); Expected result: ---------------- <xml><text>&#60;tag&#62;</text><text>&#34;quotes&#34;</text></xml> Actual result: -------------- <xml><text>&lt;tag&gt;</text><text>"quotes"</text></xml> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37878&edit=1

« previous php.bugs (#98697) next »