ID: 38672
Updated by: [EMAIL PROTECTED]
Reported By: stefano dot comarin at primeur dot com
-Status: Open
+Status: Bogus
Bug Type: SimpleXML related
Operating System: Windows 2000
PHP Version: 5.1.6
New Comment:
That's expected behaviour. The xml extension do not add whitespaces
just to make the XML look nice
Previous Comments:
------------------------------------------------------------------------
[2006-08-31 14:59:40] stefano dot comarin at primeur dot com
Description:
------------
If you add elements with addChild() and then call asXML() the added
elements are printed on the same line. This makes the XML difficult to
read.
Reproduce code:
---------------
<?php
$xmlstr = <<<XML
<a>
<b>bbb</b>
</a>
XML;
$xml = new SimpleXMLElement($xmlstr);
$xml->addChild('c', 'ccc');
$xml->addChild('d', 'ddd');
echo $xml->asXML();
?>
Expected result:
----------------
<?xml version="1.0"?>
<a>
<b>bbb</b>
<c>ccc</c>
<d>ddd</d>
</a>
Actual result:
--------------
<?xml version="1.0"?>
<a>
<b>bbb</b>
<c>ccc</c><d>ddd</d></a>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38672&edit=1