note 62666 rejected from function.domnode-replace-child by nlopess

From: Date: Mon, 06 Mar 2006 22:24:10 +0000
Subject: note 62666 rejected from function.domnode-replace-child by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-104940@lists.php.net to get a copy of this message
Note Submitter: operationsengineer1 at yahoo dot com ---- the following code doesn't work in php 5.1.2: <?php $doc = domxml_new_doc("1.0"); $root = $doc->create_element("HTML"); $doc->append_child($root); $head = $doc->create_element("HEAD"); $root->append_child($head); $title = $doc->create_element("TITLE"); $head->append_child($title); $text = $doc->create_text_node("This is the title"); $title->append_child($text); echo "<PRE>"; echo htmlentities($doc->dump_mem(true)); echo "</PRE>"; $newtitle = $doc->create_text_node("No, this is the title"); // object DomNode->replace_child ( object newnode, object oldnode) $title->replace_child($newtitle,$title->first_child()); echo "<PRE>"; echo htmlentities($doc->dump_mem(true)); echo "</PRE>"; ?> --------------------- PHP Fatal error: Call to undefined function domxml_new_doc() in C:\web\html\dmt\_debug_tmp.php on line 2 please update the code. i tried, but have failed to get anything working.

« previous php.notes (#104940) next »