I'm using libxml2 to parse HTML. The HTML might look like this:
<div>
Some very very long text here.
</div>
I want to insert a child node, e.g. a header, in before the text, like this:
<div>
<h3>
Some header here
</h3>
Some very very long text here.
</div>
Unfortunately, libxml2 always adds my header after the text, like this:
<div>
Some very very long text here.
<h3>
Some header here
</h3>
</div>
How can I solve this problem?