Author: atsushi
Date: 2005-12-08 04:48:38 -0500 (Thu, 08 Dec 2005)
New Revision: 54105

Modified:
   trunk/mcs/class/System.XML/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs
Log:
2005-12-08  Atsushi Enomoto <[EMAIL PROTECTED]>

        * XmlReaderSettings.cs : Schemas will be created only when it is
          required.



Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-12-08 09:47:42 UTC 
(rev 54104)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-12-08 09:48:38 UTC 
(rev 54105)
@@ -1,3 +1,8 @@
+2005-12-08  Atsushi Enomoto <[EMAIL PROTECTED]>
+
+       * XmlReaderSettings.cs : Schemas will be created only when it is
+         required.
+
 2005-12-08  Andrew Skiba  <[EMAIL PROTECTED]>
 
        * IXmlNamespaceResolver.cs: delete TARGET_JVM,

Modified: trunk/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs  2005-12-08 
09:47:42 UTC (rev 54104)
+++ trunk/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs  2005-12-08 
09:48:38 UTC (rev 54105)
@@ -52,6 +52,7 @@
                private bool prohibitDtd;
                private XmlNameTable nameTable;
                private XmlSchemaSet schemas;
+               private bool schemasNeedsInitialization;
                private XsValidationFlags validationFlags;
                private ValidationType validationType;
                private XmlResolver xmlResolver;
@@ -98,7 +99,8 @@
                        lineNumberOffset = 0;
                        linePositionOffset = 0;
                        prohibitDtd = true;
-                       schemas = new XmlSchemaSet ();
+                       schemas = null;
+                       schemasNeedsInitialization = true;
                        validationFlags =
                                XsValidationFlags.ProcessIdentityConstraints |
                                XsValidationFlags.AllowXmlAttributes;
@@ -160,8 +162,17 @@
                }
 
                public XmlSchemaSet Schemas {
-                       get { return schemas; }
-                       set { schemas = value; }
+                       get {
+                               if (schemasNeedsInitialization) {
+                                       schemas = new XmlSchemaSet ();
+                                       schemasNeedsInitialization = false;
+                               }
+                               return schemas;
+                       }
+                       set {
+                               schemas = value;
+                               schemasNeedsInitialization = false;
+                       }
                }
 
                internal void SetSchemas (XmlSchemaSet schemas)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to