Csharp/C Sharp/XML/DOM — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 11:38, 26 мая 2010

DOM feature check

using System;
using System.Xml;
class DomFeatureChecker {
  private static readonly string [] versions = new string [] {
    "1.0", "2.0" };
  
  private static readonly string [] features = new string [] { 
    "Core", "XML", "HTML", "Views", "Stylesheets", "CSS", 
    "CSS2", "Events", "UIEvents", "MouseEvents", "MutationEvents", 
    "HTMLEvents", "Range", "Traversal" };
  
  public static void Main(string[] args) {
    XmlImplementation impl = new XmlImplementation();
  
    foreach (string version in versions) {
      foreach (string feature in features) {
        Console.WriteLine("{0} {1}={2}", feature, version, 
          impl.HasFeature(feature, null));
      }
    }
  }
}