I need parse my document. I mean I want to replace "div" to for example "p"
so the code:
<section class="X">
<p>Some title</p>
<div data-newname="p"></div>
</section>
becomes to:
<section class="X">
<p>Some title</p>
<p></p> <- here is replacement
</section>
So the point is, I need to find element by data-attribute and replace start (<div>) and end (</div>) to anything i want to.
but I dont have idea how can I do this. I have many divs element with data attribute and I need to replace to {{Start::test}}{{End::test}} - the test is from data-attribute, or whatever..
I will be grateful for any help from you guys..