*/
function handle_tag_start(&$parser, $name, $attrs)
{
+ // we need to keep track of indicies to monitor the last key in $this->attribs
+ static $index;
+
// trim attributes
array_walk($attrs, 'trim');
}
// create a new child node
- $this->attach_node($this->attribs["$name"][] = (array)$attrs);
+ $this->attribs["$name"][ $index["$name"] ] = (array)$attrs;
+ $this->attach_node($this->attribs["$name"][ $index["$name"] ]);
+ $index["$name"]++;
}
// node set doesn't exist, so create it
else
{
- $this->attach_node($this->attribs["$name"] = (array)$attrs);
+ $this->attribs["$name"] = (array)$attrs;
+ $this->attach_node($this->attribs["$name"]);
+ $index["$name"] = 1;
}
}