ID: 34917 Updated by: [EMAIL PROTECTED] Reported By: bart at mediawave dot nl -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: Fedora Core 4 PHP Version: 5.0.5 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. libxml issue. handling it there. Previous Comments: ------------------------------------------------------------------------ [2005-10-19 15:51:56] bart at mediawave dot nl Description: ------------ When using saveXML(node) with a documentFragment an "empty tag" like <> is appended at the beginning of the string. Strangely this occurs with XHTML doctypes but not with XML documents without a doctype. I haven't tested it with other doctypes. It looks like it tries to output the documentfragment as a tag. Reproduce code: --------------- <?php $xml = '<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" []> <div> <h1>The quick brown fox jumps over the lazy dog</h1> <p>And he also jumped over a cow </p> </div> '; $doc = new DOMDocument(); $doc->loadXML($xml); $div = $doc->getElementsByTagName('div')->item(0); $frag = $doc->createDocumentFragment(); while ($childNode = $div->firstChild) { $frag->appendChild($childNode); } echo $doc->saveXML($frag); ?> Expected result: ---------------- The quick brown fox jumps over the lazy dog And he also jumped over a cow Actual result: -------------- <> The quick brown fox jumps over the lazy dog And he also jumped over a cow ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34917&edit=1