+2006-04-11 Lluis Sanchez Gual <lluis@novell.com>
+
+ * XmlSchemas.cs: In 1.1, don't allow adding two schemas
+ with the same namespaces. This is allowed in 2.0. Fixed
+ the Find() method to cope with this case. Based on a patch
+ by David Jung.
+
2006-03-22 Gert Driesen <drieseng@users.sourceforge.net>
* XmlReflectionImporter.cs: Throw NotSupportException instead of
}\r
return null;\r
}\r
- else\r
- return Find (schema, name, type);\r
+ else {\r
+ object fschema = Find (schema, name, type);\r
+#if NET_2_0\r
+ if (fschema == null) {\r
+ // still didn't find it\r
+ // (possibly table[name.Namespace] was overwritten in table due to duplicate "" keys),\r
+ // so look in all schemas (for consistiency with MS behaviour)\r
+ foreach (XmlSchema s in this) {\r
+ object ob = Find (s, name, type);\r
+ if (ob != null) return ob;\r
+ }\r
+ }\r
+#endif\r
+ return fschema;\r
+ }\r
}\r
\r
object Find (XmlSchema schema, XmlQualifiedName name, Type type)\r
{\r
string ns = ((XmlSchema) value).TargetNamespace;\r
if (ns == null) ns = "";\r
+#if ONLY_1_1\r
+ if (table.Contains (ns))\r
+ throw new InvalidOperationException ("A schema with the namespace '" + ns + "' has already been added.");\r
+#endif\r
table [ns] = value;\r
}\r
\r