function offsetGet($key) { if (is_int($key)) { return $this->list_value[$key] = so_dom::make($this->list[$key]); } $list = array(); foreach ($this as $item) { if ($item->name != $key) { continue; } $list[] = $item; } return so_dom_collection::make($list); }
function getIterator() { $list = array(); if ($attributes = $this->DOMNode->attributes) { foreach ($attributes as $child) { $list[] = $child; } } foreach ($this->DOMNode->childNodes as $child) { $list[] = $child; } return so_dom_collection::make($list)->getIterator(); }