First, here's my code:
<?php
$xml = new DOMDocument();
$xml->preserveWhiteS pace = true;
$xml->loadXML('
<html>
<head/>
<body/>
</html>
');
$node = $xml->documentElemen t->getElementsByT agName('body')->item(0);
$node->parentNode->removeChild($n ode);
echo $xml->saveHTML();
?>
Any ideas as to why that doesn't preserve the whitespace? When I
change saveHTML to saveXML, it works just fine...
<?php
$xml = new DOMDocument();
$xml->preserveWhiteS pace = true;
$xml->loadXML('
<html>
<head/>
<body/>
</html>
');
$node = $xml->documentElemen t->getElementsByT agName('body')->item(0);
$node->parentNode->removeChild($n ode);
echo $xml->saveHTML();
?>
Any ideas as to why that doesn't preserve the whitespace? When I
change saveHTML to saveXML, it works just fine...