Sgml reader for WP7

Sometimes you have to use html pages to get the data of that website in your application. For .net applications there was a great library http://developer.mindtouch.com/Community/SgmlReader to transform an html page to an XmlDocument / XDocument and makes it easy to get the data out. Unfortunately the library was not available for Windows Phone. I looked for an alternative but couldn’t find anything useful., lucky the source code was also avialable and I modified the code to be compatible with Windows Phone. I put the code on codeplex so you can easily use it in your projects to. The link is http://sgmlwp7.codeplex.com/

The api of the wp7 version didn’t changed so you can still use it by

 

XDocument FromHtml(TextReader reader) {

    // setup SGMLReader
    Sgml.SgmlReader sgmlReader = new Sgml.SgmlReader();
    sgmlReader.DocType = "HTML";
    sgmlReader.CaseFolding = Sgml.CaseFolding.ToLower;
    sgmlReader.InputStream = reader;

    // create document
    XDocument doc = XDocument.Load(sgmlReader);
    return doc;
}

Hope it helps!

  •   @tfsbuck thanks
  •   @densto @VSTS see email. one just timed out but that causing the other one that was waiting got picked up directly
  •   @VSTS did you send all your build agents already for weekend?
  •   @tfsbuck already made a issue https://t.co/u0EcaMewlV
  •   @tfsbuck back again :) you guys updated tf-cli today from .11 to .13 and now getting this error when try to publish… https://t.co/GLMVwL7HDZ
  •   @jpaternotte Soort zoekt soort! Past goed tussen de andere 149 clowns
  •   @sandeepchads @VSTS in the vsts sdk they are already visible; just returning 401
  •   RT @msbotframework: LUIS and the Azure Bot Service have just hit GA! 🎉 https://t.co/QVttVKrSWe
  •   @sandeepchads @VSTS Integration with my activity feed. Are the apis already open?
  •   @tfsbuck nice i had hard time to find the reproduction path. they also fixed my issue with publishing extension. new build task coming soon!