ID: 27783 Updated by: [EMAIL PROTECTED] Reported By: manuel dot hesse at xplib dot de -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: linux fedora core 1 PHP Version: 5.0.0RC1 New Comment:
works fine for me loading from file also creates whitespaced nodes within the document. use $dom->preserveWhiteSpace = FALSE; before loading then $dom->formatOutput = TRUE; before the save and the results will be the same whether loaded from file or memory Previous Comments: ------------------------------------------------------------------------ [2004-03-30 15:37:31] manuel dot hesse at xplib dot de Description: ------------ The formatOutput feature doesn' t work with documents, that use DomDocument::load() for creation. But it works with in memory DOM Documents. Reproduce code: --------------- $dom = new DomDocument(); $file = "/path/to/file/dom.xml"; if (file_exists($file)) { $dom->load($file); } else { $dom->appendChild(dom->createElement('foobar')); } printf("<pre>%s</pre>", htmlentities($dom->saveXML())); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27783&edit=1