ID:               35943
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php at jesperkristensen dot dk
-Status:           Open
+Status:           Bogus
 Bug Type:         DOM XML related
 Operating System: Windows XP
 PHP Version:      5.1.1
 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

It has always worked this way using a DOMElement node (double checked
5.0.2 thru 5.1.2RC2). Only way to get your expected results is when
using the actual DOMText node.


Previous Comments:
------------------------------------------------------------------------

[2006-01-09 14:05:23] php at jesperkristensen dot dk

Description:
------------
DOMNode->nodeValue expects an xml-string. If a string containing an
&-character in inputet, only the string be fore that character will be
saved. If the string containg a xml entity, the &-character wille not
be substituted with its entity but simply be written into the file.
This thing worked as expected in PHP 5.0.x

Reproduce code:
---------------
// In the example $myNode a DOMNode object, created from the following
piece of xml: <node></node>

$myNode->nodeValue = "Me & You";
// Actual xml file: <node>Me </node>
// Expected xml file: <node>Me &amp; You</node>

$myNode->nodeValue ="Me &amp; You";
// Actual xml file: <node>Me &amp; You</node>
// Expected xml file: <node>Me &amp;amp; You</node>

$val = $myNode->nodeValue;
// Works as expected

$myNode->nodeValue = $myNode->nodeValue;
// This will change the content of <node>, if it contains "&"



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35943&edit=1

Reply via email to