I have an Xml like this:
<root>
<item>
<content type="HTML">
<![CDATA[<html>
<head></head>
<body>something goes there</body>
</html>]]>
</content>
</item>
<item>
<content type="Text">
Something goes there
</content>
</item>
</root>
With content is text type, I can get with node.getTextContent().
The problem is I want to get all the Html content from Xml tree. So the result I want to get is the string:
"<html><head></head><body>some thing goes there</body></html>"
How can I do that with Document (DOM) in Android?
Note: Because I have to edit some xml content, so I can’t use SAX.
See DOM parser Example:
http://androiddevelopement.blogspot.in/2011/06/android-xml-parsing-tutorial-using.html
A xml may have different type of nodes, see possible Node Types:
http://www.w3schools.com/dom/dom_nodetype.asp
You have various methods in android to parse Xml through DOM parser, methods useful are following: