在像這樣的元素上:<self_closing attribute="1" /> 遍歷屬性後,isEmptyElement 會返回 FALSE。因此,您需要隱式調用 moveToElement(),以便將游標移回父元素並再次使用 isEmptyElement。
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
XMLReader::moveToElement — 將游標定位到目前屬性的父元素
此函式沒有參數。
在像這樣的元素上:<self_closing attribute="1" /> 遍歷屬性後,isEmptyElement 會返回 FALSE。因此,您需要隱式調用 moveToElement(),以便將游標移回父元素並再次使用 isEmptyElement。