|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-31 17:06 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 16:00:01 2025 UTC |
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>