#27436 [Opn->Csd]: dom_import_simplexml innaccurate

From: Date: Mon, 01 Mar 2004 12:39:19 +0000
Subject: #27436 [Opn->Csd]: dom_import_simplexml innaccurate
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55731@lists.php.net to get a copy of this message
ID: 27436 Updated by: rrichards@php.net Reported By: greg dot steffensen at richmond dot edu -Status: Open +Status: Closed Bug Type: XML related Operating System: Windows XP Service Pack 1 PHP Version: 5.0.0b4 (beta4) New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2004-02-29 03:44:06] greg dot steffensen at richmond dot edu Description: ------------ dom_import_simplexml(), when given a simplexml_element that is part of a larger simplexml nesting, will import the parent of the element provided, not the element itself. Reproduce code: --------------- <? $dom = new domdocument; $s = simplexml_load_string('<a>Foo<b>Bar<c/></b></a>'); $el = dom_import_simplexml($s->b->c); $el = $dom->importNode($el, TRUE); $dom->appendChild($el); print $dom->saveXML(); ?> Expected result: ---------------- <?xml version="1.0"?> <c/> Actual result: -------------- <?xml version="1.0"?> <b>Bar<c/></b> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27436&edit=1

« previous php.bugs (#55731) next »