note 28916 deleted from function.domnode-append-child by didou

From: Date: Sun, 12 Jun 2005 17:16:10 +0000
Subject: note 28916 deleted from function.domnode-append-child by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90308@lists.php.net to get a copy of this message
Note Submitter: Blah ---- As of PHP 4.3.0, DomXml apparently no longer allows you to use append_child to insert a node from one document into another. For example: $doc1 = domxml_open_mem($xmlstr1); $doc2 = domxml_open_mem($xmlstr2); $root1= $doc1->document_element(); $root2= $doc2->document_element(); // Before PHP 4.3.0, combining the documents was as simple // as this: // $root1->append_child($root2); // Now, you must first clone the node(and its children) $copiedNode = $root2->clone_node(true); $root1->append_child($copiedNode); $outputXML = $root1->dump_mem(true); --- A small change, and maybe that was always the correct way, but it got me so I thought I would share.

« previous php.notes (#90308) next »