Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / Dom / XmlImplementation.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XmlImplementation.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
7
8 using System.Globalization;
9
10 namespace System.Xml {
11
12     // Provides methods for performing operations that are independent of any
13     // particular instance of the document object model.
14     public class XmlImplementation {
15
16         private XmlNameTable nameTable;
17
18         // Initializes a new instance of the XmlImplementation class.
19         public XmlImplementation() : this( new NameTable() ) {
20         }
21
22         public XmlImplementation( XmlNameTable nt ) {
23             nameTable = nt;
24         }
25
26         // Test if the DOM implementation implements a specific feature.
27         public bool HasFeature(string strFeature, string strVersion) {
28             if (String.Compare("XML", strFeature, StringComparison.OrdinalIgnoreCase) == 0) {
29                 if (strVersion == null || strVersion == "1.0" || strVersion == "2.0")
30                     return true;
31             }
32             return false;
33         }
34
35         // Creates a new XmlDocument. All documents created from the same 
36         // XmlImplementation object share the same name table.
37         public virtual XmlDocument CreateDocument() {
38             return new XmlDocument( this );
39         }
40
41         internal XmlNameTable NameTable {
42             get { return nameTable; }
43         }
44     }
45 }