ID: 41931
User updated by: c00lways at gmail dot com
Reported By: c00lways at gmail dot com
Status: Bogus
Bug Type: DOM XML related
Operating System: windows xp prof
PHP Version: 5.2.3
New Comment:
No,
still not working:
example code:
$dom = new DomDocument();
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$xdom = $dom->createElement( "yyy", "yyyy value" );
$xdom->preserveWhiteSpace = false;
$xdom->formatOutput = true;
$xchild = $dom->createElement( "OOO", "ooo value" );
$xdom->appendChild( $xchild );
$dom->appendChild( $xdom );
echo $dom->saveXML( $xdom );
Previous Comments:
------------------------------------------------------------------------
[2007-07-09 11:52:31] [EMAIL PROTECTED]
You are probably looking at the results through a browser (or using a
different script that is buggy) as the script (once you change the
return to echo) outputs the correct results as expected.
------------------------------------------------------------------------
[2007-07-09 03:07:59] c00lways at gmail dot com
Description:
------------
when:
domdocument->preserveWhiteSpace = false;
domdocument->formatoutput( true );
...
domdocument->savexml( domelement );
does not have formatoutput effect on savexml( domelement )
the output string is only 1 line...
Reproduce code:
---------------
$dom = new DomDocument("1.0", "iso-8859-1");
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$domme = $dom->createElement( "xx" );
$domme->appendChild(new DOMElement("subxx"));
//try to force, but still same output
$domme->preserveWhiteSpace = false;
$domme->formatOutput = true;
$dom->appendChild( $domme );
return $dom->saveXML( $domme );
Expected result:
----------------
<xx>
<subxx />
</xx>
Actual result:
--------------
<xx><subxx /></xx>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41931&edit=1