Is there an easy way to get all html tags like <p> <block> ....

Topics: User Forum
Apr 27, 2011 at 6:42 AM

This is the situation:

I am working with the search engine IDOL. IDOL returns a XML document containing html snippets.

The problem is that HTML tags like href becomes invalid so I need to remove the highlight from all html attributes.

I you search for fodbold and there is a link with fodbold in it then we are in trouble. (fodbold is soccer in danish)

 http://www.sporten.dk/fodbold/chok-drillo-skal-afloese-olsen

 Becomes

http://www.sporten.dk/<em style="highlight">fodbold</em>/chok-drillo-skal-afloese-olsen

Right now I am using this xpath to get all link

links = doc.DocumentNode.SelectNodes("//a[@href]");

Is there an easy way to get all html tags like <p> <block> ....

May 2, 2011 at 7:25 PM

Try

var allNodes = doc.DocumentNode.DescendantNodes();

DocumentNode.DescendantNodes();