function startElement($parser, $tagName, $attrs) { switch ($tagName) { case "HOP": $hop = new Hop(); $hop->parse($parser, $this); $this->hops[] = $hop; break; default: break; } }