Bug #16420 Updated: new_child not working properly
| From: | s dot li at gmx dot de | Date: | Wed, 17 Apr 2002 00:18:16 +0000 |
| Subject: | Bug #16420 Updated: new_child not working properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5142@lists.php.net to get a copy of this message | ||
ID: 16420
Updated by: s.li@gmx.de
Reported By: miroslav.spanel@cad-programs.com
Status: Open
Bug Type: DOM XML related
Operating System: Windows 2000 Server
PHP Version: 4.1.2
New Comment:
It is the responsibility of the developer to use valid XML when
assigning content to a new code. 'element&value' is not valid XML. So
in my opinion this is not a bug but a developer shooting himself in the
foot :)
Previous Comments:
------------------------------------------------------------------------
[2002-04-04 04:01:29] miroslav.spanel@cad-programs.com
For now I'am using ereg_replace('[&][^amp;]','&',$value) to
correct
problem.
------------------------------------------------------------------------
[2002-04-04 03:50:56] miroslav.spanel@cad-programs.com
Description of bug:
Placing amperstand '&' in 'content' parameter of 'new_child'
method
produce trim of content at '&' position.
How to reproduce bug:
<?
$doc = new_xmldoc("1.0");
$root = $doc->add_root('root');
$chld = $root->new_child('element','element&value');
$chld->set_attribute('attr','attribute&value');
echo $doc->dumpmem();
?>
Output will be:
<?xml version="1.0"?>
<root>
<element attr="attribute&value">element</element>
</root>
Element has only 'element' value instead of 'element&value'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16420&edit=1