Esempio n. 1
0
        protected internal XmlDocument(XmlImplementation imp) : base()
        {
            _implementation = imp;
            _domNameTable = new DomNameTable(this);

            // force the following string instances to be default in the nametable
            XmlNameTable nt = this.NameTable;
            nt.Add(string.Empty);
            strDocumentName = nt.Add("#document");
            strDocumentFragmentName = nt.Add("#document-fragment");
            strCommentName = nt.Add("#comment");
            strTextName = nt.Add("#text");
            strCDataSectionName = nt.Add("#cdata-section");
            strEntityName = nt.Add("#entity");
            strID = nt.Add("id");
            strNonSignificantWhitespaceName = nt.Add("#whitespace");
            strSignificantWhitespaceName = nt.Add("#significant-whitespace");
            strXmlns = nt.Add("xmlns");
            strXml = nt.Add("xml");
            strSpace = nt.Add("space");
            strLang = nt.Add("lang");
            strReservedXmlns = nt.Add(XmlConst.ReservedNsXmlNs);
            strReservedXml = nt.Add(XmlConst.ReservedNsXml);
            strEmpty = nt.Add(String.Empty);
            baseURI = String.Empty;

            objLock = new object();
        }
Esempio n. 2
0
 public static void HasFeatureReturnsTrueForSupportedVersion()
 {
     var target = new XmlImplementation();
     Assert.True(target.HasFeature(SupportedFeature, null));
     Assert.True(target.HasFeature(SupportedFeature, "1.0"));
     Assert.True(target.HasFeature(SupportedFeature, "2.0"));
 }
Esempio n. 3
0
        protected internal XmlDocument(XmlImplementation imp) : base()
        {
            implementation = imp;
            domNameTable   = new DomNameTable(this);

            // force the following string instances to be default in the nametable
            XmlNameTable nt = this.NameTable;

            nt.Add(string.Empty);
            strDocumentName         = nt.Add("#document");
            strDocumentFragmentName = nt.Add("#document-fragment");
            strCommentName          = nt.Add("#comment");
            strTextName             = nt.Add("#text");
            strCDataSectionName     = nt.Add("#cdata-section");
            strEntityName           = nt.Add("#entity");
            strID = nt.Add("id");
            strNonSignificantWhitespaceName = nt.Add("#whitespace");
            strSignificantWhitespaceName    = nt.Add("#significant-whitespace");
            strXmlns         = nt.Add("xmlns");
            strXml           = nt.Add("xml");
            strSpace         = nt.Add("space");
            strLang          = nt.Add("lang");
            strReservedXmlns = nt.Add(XmlConst.ReservedNsXmlNs);
            strReservedXml   = nt.Add(XmlConst.ReservedNsXml);
            strEmpty         = nt.Add(String.Empty);
            baseURI          = String.Empty;

            objLock = new object();
        }
Esempio n. 4
0
 public static void HasFeatureReturnsTrueForSupportedFeature()
 {
     var target = new XmlImplementation();
     // verify that it's also case-insensitive
     Assert.True(target.HasFeature(SupportedFeature.ToUpper(), null));
     Assert.True(target.HasFeature(SupportedFeature.ToLower(), null));
 }
 protected internal XmlDocument(XmlImplementation imp)
 {
     this.implementation = imp;
     this.domNameTable = new DomNameTable(this);
     XmlNameTable nameTable = this.NameTable;
     nameTable.Add(string.Empty);
     this.strDocumentName = nameTable.Add("#document");
     this.strDocumentFragmentName = nameTable.Add("#document-fragment");
     this.strCommentName = nameTable.Add("#comment");
     this.strTextName = nameTable.Add("#text");
     this.strCDataSectionName = nameTable.Add("#cdata-section");
     this.strEntityName = nameTable.Add("#entity");
     this.strID = nameTable.Add("id");
     this.strNonSignificantWhitespaceName = nameTable.Add("#whitespace");
     this.strSignificantWhitespaceName = nameTable.Add("#significant-whitespace");
     this.strXmlns = nameTable.Add("xmlns");
     this.strXml = nameTable.Add("xml");
     this.strSpace = nameTable.Add("space");
     this.strLang = nameTable.Add("lang");
     this.strReservedXmlns = nameTable.Add("http://www.w3.org/2000/xmlns/");
     this.strReservedXml = nameTable.Add("http://www.w3.org/XML/1998/namespace");
     this.strEmpty = nameTable.Add(string.Empty);
     this.baseURI = string.Empty;
     this.objLock = new object();
 }
Esempio n. 6
0
        public static void TestForFeatureSome()
        {
            var imp = new XmlImplementation();

            Assert.False(imp.HasFeature("some", "1.0"));
            Assert.False(imp.HasFeature("some", "2.0"));
            Assert.False(imp.HasFeature("some", "3.0"));
        }
Esempio n. 7
0
        public static void CreateDocument()
        {
            var imp = new XmlImplementation();

            var doc1 = imp.CreateDocument();
            var doc2 = imp.CreateDocument();

            Assert.NotNull(doc1);
            Assert.NotNull(doc2);
            Assert.NotSame(doc1, doc2);
        }
Esempio n. 8
0
 public XmlDocument(XmlNameTable nt) : base(null)
 {
     if (nt != null)
     {
         implementation = new XmlImplementation(nt);
     }
     else
     {
         implementation = new XmlImplementation();
     }
     Initialize();
 }
Esempio n. 9
0
 protected internal XmlDocument(XmlImplementation imp) : base(null)
 {
     if (imp != null)
     {
         implementation = imp;
     }
     else
     {
         implementation = new XmlImplementation();
     }
     Initialize();
 }
Esempio n. 10
0
	public XmlDocument(XmlNameTable nt) : base(null)
			{
				if(nt != null)
				{
					implementation = new XmlImplementation(nt);
				}
				else
				{
					implementation = new XmlImplementation();
				}
				Initialize();
			}
Esempio n. 11
0
	protected internal XmlDocument(XmlImplementation imp) : base(null)
			{
				if(imp != null)
				{
					implementation = imp;
				}
				else
				{
					implementation = new XmlImplementation();
				}
				Initialize();
			}
Esempio n. 12
0
        XmlDocument(XmlImplementation impl, XmlNameTable nt) : base(null)
        {
            if (impl == null)
            {
                implementation = new XmlImplementation();
            }
            else
            {
                implementation = impl;
            }

            nameTable = (nt != null) ? nt : implementation.InternalNameTable;
            nameCache = new XmlNameEntryCache(nameTable);
            AddDefaultNameTableKeys();
            resolver = new XmlUrlResolver();
        }
Esempio n. 13
0
        XmlDocument(XmlImplementation impl, XmlNameTable nt) : base(null)
        {
            if (impl == null)
            {
                implementation = new XmlImplementation();
            }
            else
            {
                implementation = impl;
            }

            nameTable = (nt != null) ? nt : implementation.InternalNameTable;
            nameCache = new XmlNameEntryCache(nameTable);
            AddDefaultNameTableKeys();
            resolver = new XmlUrlResolver();

            Type type = GetType();

            optimal_create_element   = type.GetMethod("CreateElement", optimal_create_types).DeclaringType == typeof(XmlDocument);
            optimal_create_attribute = type.GetMethod("CreateAttribute", optimal_create_types).DeclaringType == typeof(XmlDocument);
        }
Esempio n. 14
0
 protected internal XmlDocument(XmlImplementation imp) : this(imp, null)
 {
 }
Esempio n. 15
0
 public static void HasFeatureReturnsFalseForUnsupportedVersion()
 {
     var target = new XmlImplementation();
     Assert.False(target.HasFeature(SupportedFeature, "1.2"));
 }
Esempio n. 16
0
 internal XmlDataDocument(XmlImplementation imp) : base(imp)
 {
 }
Esempio n. 17
0
		public DOMImplementation()
			: base(ScriptContext.CurrentContext, true)
		{
			XmlImplementation = new XmlImplementation();
		}
Esempio n. 18
0
 // Constructors.
 public XmlDocument() : base(null)
 {
     implementation = new XmlImplementation();
     Initialize();
 }
Esempio n. 19
0
 public static void HasFeatureReturnsFalseForUnsupportedFeature()
 {
     var target = new XmlImplementation();
     Assert.False(target.HasFeature("Unsupported", null));
 }
 /// <summary>
 /// Initializes a new instance of the SafeXmlDocument class with the specified XmlImplementation.
 /// </summary>
 /// <remarks>Not supported do to no use within exchange dev code.</remarks>
 /// <param name="imp">The XmlImplementation to use.</param>
 public SafeXmlDocument(XmlImplementation imp)
 {
     throw new NotSupportedException("Not supported");
 }
Esempio n. 21
0
		protected internal XmlDocument (XmlImplementation imp) : this (imp, null)
		{
		}
Esempio n. 22
0
	// Constructors.
	public XmlDocument() : base(null)
			{
				implementation = new XmlImplementation();
				Initialize();
			}
Esempio n. 23
0
		XmlDocument (XmlImplementation impl, XmlNameTable nt) : base (null)
		{
			if (impl == null)
				implementation = new XmlImplementation ();
			else
				implementation = impl;

			nameTable = (nt != null) ? nt : implementation.InternalNameTable;
			nameCache = new XmlNameEntryCache (nameTable);
			AddDefaultNameTableKeys ();
			resolver = new XmlUrlResolver ();
			
			Type type = GetType ();
			optimal_create_element = type.GetMethod ("CreateElement", optimal_create_types).DeclaringType == typeof (XmlDocument);
			optimal_create_attribute = type.GetMethod ("CreateAttribute", optimal_create_types).DeclaringType == typeof (XmlDocument);
		}
Esempio n. 24
0
        /// <include file='doc\XmlDocument.uex' path='docs/doc[@for="XmlDocument.XmlDocument2"]/*' />
        protected internal XmlDocument( XmlImplementation imp ): base() {

            this.implementation = imp;
            idTable = new XmlIdentityTable( this );

            // force the following string instances to be default in the nametable
            XmlNameTable nt = this.NameTable;
            nt.Add( string.Empty );
            nt.Add( strDocumentName );
            nt.Add( strDocumentFragmentName );
            nt.Add( strCommentName );
            nt.Add( strTextName );
            nt.Add( strCDataSectionName );
            nt.Add( strEntityName );
            nt.Add( strID );
            nt.Add( strNonSignificantWhitespaceName );
            nt.Add( strSignificantWhitespaceName );
            nt.Add( strXmlns );
            nt.Add( strXml );
            nt.Add( strSpace );
            nt.Add( strLang );
            nt.Add( strReservedXmlns );
            nt.Add( strEmpty );

            nullNode = new XmlDocumentFragment( this );
            eleIds = new XmlElementIdMap(this);
            loader = new XmlLoader();
            _schemaInfo = null;
            isLoading = false;

            fEntRefNodesPresent = false;
            fIsEdited = false;
            fCDataNodesPresent = false;

            bSetResolver = false;
            resolver = null;

            this.objLock = new object();
        }