#27783 [Opn->Bgs]: DomDocument::formatOutput = true doesn' work with loaded files.
| From: | rrichards@php.net | Date: | Wed, 31 Mar 2004 17:16:20 +0000 |
| Subject: | #27783 [Opn->Bgs]: DomDocument::formatOutput = true doesn' work with loaded files. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57242@lists.php.net to get a copy of this message | ||
ID: 27783
Updated by: rrichards@php.net
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