How to join text nodes between br tags again by br.
Here is the xml code
<div>
text1.
<br>
text2.
<br>
text3.
<div>ad sense code</div>
<br>
text4.
<div>ad sense code</div>
<br>
textxx.
<br>
</div>
I need to get all text node text2 to textxx joined by br tag or \n\n.
I can get all the text but joined without any separator using //div/text()[position()>1] but the result like this:
text1.text2.text3.text4.textxx.
while I want it like this:
text1.<br>text2.<br>text3.<br>text4.<br>textxx.<br>
Simply I need to keep the br tags. I am using Perl HTML::TreeBuilder::LibXML module.