RE: [PEAR] XML_Tree/insertChild

From: Date: Tue, 25 Feb 2003 09:44:16 +0000
Subject: RE: [PEAR] XML_Tree/insertChild
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3943@lists.php.net to get a copy of this message
Oops, forgot one line - function &addChild($child, $content = '', $attributes = array()) { + function &addChild(&$child, $content = '', $attributes = array()) { $index = sizeof($this->children); - + if (is_object($child)) { - if (strtolower(get_class($child)) == 'xml_tree_node') { + $type = strtolower( get_class($child)); + + if ($type != 'xml_tree') { $this->children[$index] = $child; } - if (strtolower(get_class($child)) == 'xml_tree' && isset($child->root)) { + if ($type == 'xml_tree' && isset($child->root)) { $this->children[$index] = $child->root->get_element(); > -----Original Message----- > From: Arash Yalpani [mailto:arash@yalpani.de] > Sent: Tuesday, February 25, 2003 10:39 AM > To: pear-general@lists.php.net > Subject: Re: [PEAR] XML_Tree/insertChild > > > > has anybody used XML_Tree::insertChild before? The > API-Description is far > > from beeing understandable. If someone has a working example I would > really > > be thankful! > > Trying to use XML_Tree::insertChild I get an error message, > saying that > method "get_node_by_path" (called by insertChild) is > undefined. Searching > globally through the PEAR-archive I could not find get_node_by_path > anywhere. > So it seems to me, that insertChild is not ready to use at > the moment. Am I > wrong? > > Greets, Arash > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.general (#3943) next »