From:             clynx at succont dot de
Operating system: FreeBSD 4.11
PHP version:      5CVS-2005-03-02 (dev)
PHP Bug Type:     DOM XML related
Bug description:  New Fragment has Empty Content

Description:
------------
When creating a new DocumentFragment, and appending some Child Nodes, the
Fragment is still Empty. The Content is inside the DomDocument, but cannot
be accessed through the Fragment Node.

Reproduce code:
---------------
<?php
$xmlData = <<<XMLDATA
<?xml version="1.0" encoding="ISO-8859-1" ?>
<root>
        <subElement>content</subElement>
</root>
XMLDATA;

$dom = new DomDocument;
$dom->loadXML( $xmlData );

$dom2 = new DomDocument;
$fragment = $dom2->createDocumentFragment();
foreach( $dom->childNodes AS $node ) {
        $newNode = $dom2->importNode( $node, true );
        $fragment->appendChild( $newNode );
}
$dom2->appendChild( $fragment );

echo $dom2->saveXML( $fragment );
?>

Expected result:
----------------
<root>
        <subElement>content</subElement>
</root>

Actual result:
--------------
no output (empty String is returned)

-- 
Edit bug report at http://bugs.php.net/?id=32163&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32163&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32163&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32163&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32163&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32163&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32163&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32163&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32163&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32163&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32163&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32163&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32163&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32163&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32163&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32163&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32163&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32163&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32163&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32163&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32163&r=mysqlcfg

Reply via email to