Bug #67476 [NEW]: empty node is filled with sibling

From: Date: Thu, 19 Jun 2014 11:38:17 +0000
Subject: Bug #67476 [NEW]: empty node is filled with sibling
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186254@lists.php.net to get a copy of this message
From:             info at gmwconsult dot nl
Operating system: windows
PHP version:      5.4Git-2014-06-19 (snap)
Package:          DOM XML related
Bug Type:         Bug
Bug description:empty node is filled with sibling

Description:
------------
if I load a snippet of html with loadXML() and subsequently echo the
contents, the first empty node is filled with the next node. This does
not happen if the first node contains   or another empty node.
So the result will be:
<div>
    <nav id="filter" >
        <section id="portfolio_container">
        	<ul id="stage">
            </ul>
        </section>
    </nav>
</div>

php 5.4.19 that comes with xampp running on windows

Test script:
---------------
$html = '<div>
        <nav id="filter" />
        <section id="portfolio_container">
        	<ul id="stage">
            </ul>
        </section>
		</div>';
$doc = new DOMDocument('1.0','utf8');
$doc->loadXML($html);
echo"<pre>";
print_r($doc->saveXML());
echo"</pre>";
die();


-- 
Edit bug report at https://bugs.php.net/bug.php?id=67476&edit=1
-- 



Thread (3 messages)

« previous php.bugs (#186254) next »