A pedant that hangs out in the dark corner-cases of the web.

Wednesday, February 24, 2010

Is the end of IE6 finally in sight?

Internet Explorer Contract Addendum - Monday By NoonShould I bother supporting IE6? - Pro Webmasters - Stack ExchangeBrowse SadRIPIE6.comIE6 No MoreBring Down IE 6Explorer DestroyerI Don't Support IE6I dropped Internet Explorer 6StopIEStop Internet ExplorerSaveIE6 ;)Dear IE6IE6ify BookmarkletIE sucksWhy IE SucksEnough IE6Is Internet Explorer 6 Dead?Do I have IE6?IE6 MUST DIEDeath To IE6IE Death MarchHEY-IT - We want to get rid of IE6!Explorer Exposed!IE6 Must Die - Support now! - Twibbon.comPhase Out IE6IE6 UpdateDearIE6 - So LongGOODBYE IE6... I hate you!IE6 Redirection ScriptIE 6 Blocker Script | CSS-TricksIE6 Countdown to DeathToo Cool for Internet ExplorerUpdate Your BrowserBrowser-Update.orgBrowser Upgrade InformationPushuptheweb.comKill Bill's Browser - Switch to FirefoxBrowse HappyIt's Time to Choose A Better BrowserAlternative Browser AllianceCrash IEIEUpdate.nldrop-ie6.dk — Sig farvel til Internet Explorer 6ie6 - aktualizuj ju┼╝ teraz!IE6 FuneralKILL IE 6NoIE6IE6: Do NOT want!The best way to support IE6?Am I using IE6?End 6!StopIE6.comIE6OffendersThe IE6 ListStop Living in the Past! Upgrade IE6

Word on the street is that July 13, 2010 is the official end of life for IE6. Maybe it'll get extended, but Digg has already dropped support, Google Sites and Docs will on March 1, 2010, Google has announced YouTube will drop support March 13, 2010, and Microsoft has been encouraging users to upgrade.

There have been efforts toward, and hopes and predictions of IE6's death in the past, and maybe some (primarily corporate) users may continue to use it anyway. However, Google provides huge momentum, and news coverage, discussion, angry T-shirts, and voodoo dolls are going to make justification of coasting along on IE6 much harder from now on. Norway has been in the fight for a while, there's a petition to pull IE6 from the UK government, and even the hubris of a funeral for IE6.

It just seems like the time is right to spend less time on crazy, quixotic fixes, and invest some time (at least for a while) helping educate or encourage users to make a better browser decision.

Monday, February 01, 2010

Converting between XDocument and XmlDocument, XElement and XmlElement

Here's a class to provide extension methods for conversion between System.Xml and System.Xml.Linq classes:

using System.Xml;
using System.Xml.Linq;

/// <summary>
/// Provides extension methods for simple conversion between System.Xml and System.Xml.Linq classes.
/// </summary>
public static class XmlLinqConversionExtensions
{
  /// <summary>
  /// Converts an XDocument to an XmlDocument.
  /// </summary>
  /// <param name="xdoc">The XDocument to convert.</param>
  /// <returns>The equivalent XmlDocument.</returns>
  public static XmlDocument ToXmlDocument(this XDocument xdoc)
  {
    var xmldoc = new XmlDocument();
    xmldoc.Load(xdoc.CreateReader());
    return xmldoc;
  }
  
  /// <summary>
  /// Converts an XmlDocument to an XDocument.
  /// </summary>
  /// <param name="xmldoc">The XmlDocument to convert.</param>
  /// <returns>The equivalent XDocument.</returns>
  public static XDocument ToXDocument(this XmlDocument xmldoc)
  {
    return XDocument.Load(xmldoc.CreateNavigator().ReadSubtree());
  }
  
  /// <summary>
  /// Converts an XElement to an XmlElement.
  /// </summary>
  /// <param name="xelement">The XElement to convert.</param>
  /// <returns>The equivalent XmlElement.</returns>
  public static XmlElement ToXmlElement(this XElement xelement)
  {
    return new XmlDocument().ReadNode(xelement.CreateReader()) as XmlElement;
  }
  
  /// <summary>
  /// Converts an XmlElement to an XElement.
  /// </summary>
  /// <param name="xmlelement">The XmlElement to convert.</param>
  /// <returns>The equivalent XElement.</returns>
  public static XElement ToXElement(this XmlElement xmlelement)
  {
    return XElement.Load(xmlelement.CreateNavigator().ReadSubtree());
  }
}