I am using org.w3c.dom APIs to parse a a HTML fragment which is composed of a series of
tags with various markups in between. I am trying to ingest the HTML fragment into a org.w3c.dom.Document and splitting on the HTML into the <p>..</p>
I can easily get a NodeList of the <p>
tags (doc.getElementsByTagName("p")
) however from the NodeList I am having trouble getting the equivalent of "innerHTML" and "outerHTML" of the elements in the NodeList.
How can i get the equivalent of innerHTML and outerHTML w the org.w3c.dom APIs? (I dont want to introduce another dependency such as JSoup)