Edit report at http://bugs.php.net/bug.php?id=27783&edit=1

 ID:                 27783
 Comment by:         bacurastone at ymail dot com
 Reported by:        manuel dot hesse at xplib dot de
 Summary:            DomDocument::formatOutput = true doesn' work with
                     loaded files.
 Status:             Bogus
 Type:               Bug
 Package:            DOM XML related
 Operating System:   linux fedora core 1
 PHP Version:        5.0.0RC1
 Block user comment: N
 Private report:     N

 New Comment:

for rricha...@php.net thanks. it's help full


Previous Comments:
------------------------------------------------------------------------
[2004-03-31 12:16:19] rricha...@php.net

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

------------------------------------------------------------------------
[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/bug.php?id=27783&edit=1

Reply via email to