views:

39

answers:

2

I'm going to be doing some webscraping and my plan is to have something like this:

public class Searcher
{
    public void Search(string searchTerm)
    {
    }

    private void Search(string term)
    { 
        //Some HTMLAgilityPack Voodoo here
    }

    private void SaveResults()
    {
        //Actually save the results as .XML file.
    }
}

Thanks!

+1  A: 

Either the XDocument or XmlDocument classes will allow you to keep XML in memory as XML.

John Saunders
Which in your opinion is better?
Serg
@Sergio: XDocument and LINQ to XML is much better. `XmlDocument` is the "day 1" XML DOM implementation.
John Saunders
XDocument is newer, and if you're comfortable with LINQ, you'll probably find it easier to use.
Michael Petrotta
+1  A: 

Look into XDocument.Load and XDocument.Save with LINQ to XML if you're using .NET 3.5+

Davy8