Re: XML_Tree and mixed content tags

From: Date: Mon, 14 Apr 2003 10:47:10 +0000
Subject: Re: XML_Tree and mixed content tags
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15161@lists.php.net to get a copy of this message
> When XML_Tree parse the following XML: > > <tree>4 > <node></node> > </tree> > > It produces a single root node (<tree>) but with two child nodes instead of > one. The first child node is for the "4" content, and the second for the > <node> tag. Is this correct? IMO there should only be only a single child > node, with the content being assigned to the root <tree> node. And here's a diff in which would fix the issue: Index: Tree.php =================================================================== RCS file: /repository/pear/XML_Tree/Tree.php,v retrieving revision 1.23 diff -b -u -r1.23 Tree.php --- Tree.php 4 Jan 2003 11:56:34 -0000 1.23 +++ Tree.php 14 Apr 2003 10:45:57 -0000 @@ -235,7 +235,7 @@ if (!empty($this->cdata)) { $parent_id = 'obj' . ($this->i - 1); $parent =& $this->$parent_id; - $parent->children[] = &new XML_Tree_Node(null, $this->cdata); + $parent->content = $this->cdata; } $obj_id = 'obj' . $this->i++; $this->$obj_id = &new XML_Tree_Node($elem, null, $attribs); -- Richard Heyes V-webmail - http://www.v-webmail.org

« previous php.pear.dev (#15161) next »