This is just way cool.  Check out Eric White’s blog for a slick use of extension methods to make it easier to convert types in the System.Xml namespace to types in the System.Xml.Linq namespace , and vice-versa.  Here’s a quick teaser: XElement e = new XElement( "Root" , new XElement( "Child" , new XAttribute( "Att" , "1" ) ) ); XmlNode xmlNode = e.GetXmlNode(); Console.WriteLine(xmlNode.OuterXml); XElement newElement = xmlNode.GetXElement(); Console.WriteLine(newElement); No, that code won’t compile on its own, you need to define the GetXElement and GetXmlNode methods as described in Eric White’s blog .  It just wouldn’t be fair to post it here.

Go here to see the original: 
Convert XElement to XmlNode (and Convert XmlNode to XElement)

Filed under: 2008, 2009, 3.0, ads, app, application, archive, art, atom, att, baseball, cd, cli, cloud, community, compile, convert, Cookie, css, data, development, EFI, ego, email, event, events, football, fun, hockey, im, ion, languages, life, mail, march, marketing, media, Meta, microsoft, Microsoft Rules, mmo, mobile, new, news, office, personal, pro, Q1, rip, screen, script, search, security, server, Software, tags, talk, tasks, theme, themes, tor, trends, ui, update, value, windows, xbox

JUMP TO TOP
SHARE THIS POST

Hurricane Sandy and My Windows Phone