Do I need to construct my own DOM tree?

Topics: User Forum
Sep 1, 2006 at 12:09 AM
Hi, I was writing a program that compares the structure similarity of two HTML documents. The program needs to do a lot of tree operations (add/delete nodes, runs tree matching algorithm, and etc).
Is it better to construct a new DOM tree (by keep calling HtmlNode.ChildNodes() )? Or it's completely unnecessary?

Another quick question...how can I access the root node of the DOM tree? Is the following call right?
HtmlNode root = htmlDoc.SelectSingleNode(path)
Sep 1, 2006 at 12:26 AM
sorry, I found it's clearly written in the help document. I should use htmlDoc.DocumentNode() to get the root node.

Thanks~:)