For this XML:
<row>
<entry XY="1" al="23" se="5" ag="fgh"> </entry>
<entry XY="1" al="23" se="5" ag="fgh">Content1</entry>
<entry XY="1" al="23" se="5" ag="fgh">Content2</entry>
<entry XY="1" al="23" se="5" ag="fgh"> </entry>
<entry XY="1" al="23" se="5" ag="fgh">Content3</entry>
</row>
I have the following loop:
foreach ($toc_element->entry as $toc_element_line) {
if ($toc_element_line->xpath('/*[text()]')) {
array_push($arr, $toc_element_line);
}
}
I am trying to test if the current element is empty. The Object itself is never empty, because the potentially empty element, always has attributes (that I don't care about).
Is the XPath approach (which I am noticeably new to) correct? If so, how would I write it?
Thanks a lot in advance. (I know that there are some questions of that kind here on stackoverflow, but I couldn't quite figure it out)