2006-07-25 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 25 Jul 2006 03:19:21 +0000 (03:19 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 25 Jul 2006 03:19:21 +0000 (03:19 -0000)
* XmlSchema.cs : mutual schema import was failing because the
  compiling schema's SourceUri was not enlisted for nest check.

* XmlSchemaTests.cs : added TestSimpleMutualImport().

* inter-inc-1.xsd, inter-inc-2.xsd :
  new test files for TestSimpleMutualImport().

svn path=/trunk/mcs/; revision=62941

mcs/class/System.XML/System.Xml.Schema/ChangeLog
mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs
mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs
mcs/class/System.XML/Test/XmlFiles/xsd/ChangeLog
mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-1.xsd [new file with mode: 0644]
mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-2.xsd [new file with mode: 0644]

index d00c5c16f4264580871598e3e5f2e22502d20743..d4072389bc789c397bad01291f3d3fd4e16b2fd1 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-25  Atsushi Enomoto <atsushi@ximian.com>
+
+       * XmlSchema.cs : mutual schema import was failing because the
+         compiling schema's SourceUri was not enlisted for nest check.
+
 2006-03-02  Atsushi Enomoto <atsushi@ximian.com>
 
        * XmlSchema.cs : seems like there is XmlSchemaExternal.Schema property
index dc0a7d2099f6ab5784e06a06d1ab6fca77ddf0ff..199b58cc37fefc66ac6bcd324fa2706c0bede305 100644 (file)
@@ -357,8 +357,12 @@ namespace System.Xml.Schema
 #endif
                                compilationItems.Add (Items [i]);
                        }
-                       if (this == rootSchema)
+                       if (this == rootSchema) {
                                handledUris = new Hashtable ();
+                               // Add this schema itself.
+                               if (SourceUri != null && SourceUri.Length > 0)
+                                       handledUris.Add (SourceUri, SourceUri);
+                       }
 
                        // First, we run into inclusion schemas to collect 
                        // compilation target items into compiledItems.
index bb22941967163fe9987da810e320af703db28177..661164a1e35f5c5aed1dc97c5191836a8a165863 100644 (file)
@@ -1,3 +1,7 @@
+2006-07-25  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XmlSchemaTests.cs : added TestSimpleMutualImport().
+
 2006-04-27  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * XmlSchemaCollectionTests.cs: added test for bug #78220.
index 84c6cc35d1604d79157746e83febdc125ec82eee..39bddbcf83e245152d1bf75db0f7bb05d79076e0 100644 (file)
@@ -169,6 +169,17 @@ namespace MonoTests.System.Xml
                        
                }
 
+               [Test]
+               public void TestSimpleMutualImport ()
+               {
+                       XmlReader r = new XmlTextReader ("Test/XmlFiles/xsd/inter-inc-1.xsd");
+                       try {
+                               XmlSchema.Read (r, null).Compile (null);
+                       } finally {
+                               r.Close ();
+                       }
+               }
+
                [Test]
                public void TestQualification ()
                {
index 729f6af0e060333c6754e7cee94d1da0e7f86f5f..d58fa84fff0dfac5e1631157264e78fed1b60abf 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-25  Atsushi Enomoto <atsushi@ximian.com>
+
+       * inter-inc-1.xsd, inter-inc-2.xsd :
+         new test files for TestSimpleMutualImport().
+
 2006-03-02  Atsushi Enomoto <atsushi@ximian.com>
 
        * 77687.xsd, 77687inc.xsd : test for bug #77687.
diff --git a/mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-1.xsd b/mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-1.xsd
new file mode 100644 (file)
index 0000000..6c51d11
--- /dev/null
@@ -0,0 +1,4 @@
+<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:foo'>
+  <xs:import namespace='urn:bar' schemaLocation='inter-inc-2.xsd' />
+  <xs:element name='foo' />
+</xs:schema>
diff --git a/mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-2.xsd b/mcs/class/System.XML/Test/XmlFiles/xsd/inter-inc-2.xsd
new file mode 100644 (file)
index 0000000..57692f8
--- /dev/null
@@ -0,0 +1,4 @@
+<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:bar'>
+  <xs:import namespace='urn:foo' schemaLocation='inter-inc-1.xsd' />
+  <xs:element name='bar' />
+</xs:schema>