PHPverse 2025

XMLReader::moveToElement

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

XMLReader::moveToElementPosiciona o cursor no elemento pai do atributo atual

Descrição

public XMLReader::moveToElement(): bool

Move o cursor para o elemento pai do atributo atual.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Retorna true se for bem sucedido e false se falhar ou se não estiver posicionado em um atributo quando este método for chamado.

Veja Também

adicione uma nota

Notas Enviadas por Usuários (em inglês) 1 note

up
3
Sean Colin Ruiz
8 years ago
On an element like this: <self_closing attribute="1" /> isEmptyElement will return FALSE after you have iterated through the attributes. So you need to use implicitly call moveToElement(), in order to move the cursor back to the parent element and use isEmptyElement again.
To Top