From:             brandenrauch at gmail dot com
Operating system: XP
PHP version:      5.1.4
PHP Bug Type:     DOM XML related
Bug description:  Dom Automatically Replaces ASCII Entities Regardless of 
substituteEntities

Description:
------------
For my project my data is passing through both xml and xsl. I've chosen to
use decimal (ascII) entities--ex: "--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 bug report at http://bugs.php.net/?id=37878&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37878&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37878&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37878&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37878&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37878&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37878&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37878&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37878&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37878&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37878&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37878&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37878&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37878&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37878&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37878&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37878&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37878&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37878&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37878&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37878&r=mysqlcfg

Reply via email to