CakeFest 2024: The Official CakePHP Conference

XMLReader::moveToElement

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

XMLReader::moveToElement現在の属性の親要素にカーソルを移動する

説明

public XMLReader::moveToElement(): bool

現在の属性の親要素にカーソルを移動します。

パラメータ

この関数にはパラメータはありません。

戻り値

成功した場合に true、失敗した場合、 あるいはメソッドがコールされた際の位置が属性ノードではなかった場合に false を返します。

参考

add a note

User Contributed Notes 1 note

up
4
Sean Colin Ruiz
7 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