|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-01 07:39 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
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>