protected function expectStartTag($reader, $expectedTag)
    {
        $node = $this->readNode($reader);

        $type = $node->nodeType;
        if ($type !== \XMLReader::ELEMENT) {
            $type = isset(self::$types[$type]) ? self::$types[$type] : "#$type";
            throw new \InvalidArgumentException(
                "Expected an opening $expectedTag tag ".
                "but got a node of type $type instead"
            );
        }

        $readTag = $node->name;
        if ($readTag !== $expectedTag) {
            throw new \InvalidArgumentException(
                "Got opening tag for $readTag instead of $expectedTag"
            );
        }

        $this->prepareNextNode();
    }
protected function expectStartTag($reader, $expectedTag)
    {
        $node = $this->readNode($reader);

        $type = $node->nodeType;
        if ($type !== \XMLReader::ELEMENT) {
            $type = isset(self::$types[$type]) ? self::$types[$type] : "#$type";
            throw new \InvalidArgumentException(
                "Expected an opening $expectedTag tag ".
                "but got a node of type $type instead"
            );
        }

        $readTag = $node->name;
        if ($readTag !== $expectedTag) {
            throw new \InvalidArgumentException(
                "Got opening tag for $readTag instead of $expectedTag"
            );
        }

        $this->prepareNextNode();
    }
protected function expectStartTag ( $ reader , $ expectedTag ) { $ node = $ this -> readNode ( $ reader ) ; $ type = $ node -> nodeType ; if ( $ type !== \ XMLReader :: ELEMENT ) { $ type = isset ( self :: $ types [ $ type ] ) ? self :: $ types [ $ type ] : "#$type" ; throw new \ InvalidArgumentException ( "Expected an opening $expectedTag tag " . "but got a node of type $type instead" ) ; } $ readTag = $ node -> name ; if ( $ readTag !== $ expectedTag ) { throw new \ InvalidArgumentException ( "Got opening tag for $readTag instead of $expectedTag" ) ; } $ this -> prepareNextNode ( ) ; }
Read a node from the document and throw
an exception if it is not an opening tag
with the given name.

\param XMLReader $reader
Reader object the node will be read from.

\param string $expectedTag
Name of the tag we're expecting.

\throw InvalidArgumentException
Thrown whenever one of the following
conditions is met:
- We reached the end of the document.
- The next node was not an opening tag.
- The next node was an opening tag, but
its name was not the one we expected.
Read a node from the document and throw an exception if it is not an opening tag with the given name .