private function parse_element_open()
{
$tag = rtrim($this->up_to_chr(self::$CHR_TAG_END . self::$CHR_WHITESPACE), self::$CHR_TAG_END_TRIM);
if ($tag != '') {
$attr = $this->parse_attributes();
$char = $this->get();
if ($char == '/' && $this->peek() == '>' || in_array($tag, self::$empty_elements)) {
// empty element
if ($char == '/' && $this->peek() == '>') {
// empty element in collapsed form
$this->inc();
// skip peeked '>'
}
$this->node(self::NODE_TYPE_ELEMENT_EMPTY, $tag, null, $attr);
} else {
$this->node(self::NODE_TYPE_ELEMENT_OPEN, $tag, null, $attr);
}
}
return self::$STATE_START;
}