considering the following : (mixture of <br> and <br/>)
text1
<br>
text2
<br/>
text3
<br/>
text4
<br>
text5
How can I locate each text nodes ?
I am thinking something that fits the condition of preceding OR following a br tag….but unsure if <br> and <br/> are treated differently in xpath.
DOMDocument‘s loadHtml() method works well with invalid HTML fragments, so you can use DOMXPath this way: