i m working on wrapper generation and i want any method in java to convert html source code to DOM tree for it. my html is a string and wanted that to be converted into DOM tree. plz help.
How to create dom tree from html
Collapse
X
-
To my knowledge, there is no "easy and small" application to do it. HTML can contain Javascript that directly manipulates the DOM tree, so the application must also interpret Javascript (and VBScript if it should run in IE etc.). So why don't you use the parsing engine of an open source browser to convert the HTML into a DOM?
I used HtmlUnit for a similar purpose.
Comment