DOM feature check : DOM « XML « C# / C Sharp

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));


Related examples in the same category

1.Create Xml Document, Node
2.Load String from xml element
3.Load boolean value from xml element
4.Get integer value from xml element
5.Get attribute from XmlNode
6.Set Xml Node Value
7.Get Value String from Xml
8.Get InnerXml without changing the spacing
9.Get Inner Xml
10.Add Xml Element
11.Returns the InnerText value from a node or string.Empty if the node is null.
12.Sets the inner text in a node. If the node doesn't exist, it creates a new one and adds the text to it.