Author: arina
Date: 2008-02-03 05:05:06 -0500 (Sun, 03 Feb 2008)
New Revision: 94667

Modified:
   trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
   trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs
Log:
Fix for exporting of a generated typed DataTable and typed DataSet. Bug 8894
        


Modified: trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2008-02-03 08:59:57 UTC (rev 94666)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2008-02-03 10:05:06 UTC (rev 94667)
@@ -1,3 +1,9 @@
+2008-02-03 Arina Itkes <[EMAIL PROTECTED]>
+
+       * XmlSchemaExporter.cs : Generated typed DataTable and typed DataSet 
+         have an identical schema and an identical TargetNamespace. 
+         This fix is a workaround for this specific case.
+
 2008-01-24  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * TypeData.cs : fixed setter which did not actually see the argument.

Modified: 
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs    
2008-02-03 08:59:57 UTC (rev 94666)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaExporter.cs    
2008-02-03 10:05:06 UTC (rev 94667)
@@ -239,12 +239,20 @@
                                schemas.Add (map.Schema);
                                ImportNamespace (currentSchema, targetNs);
                }
-               else if (existingSchema != map.Schema)
+                       else if (existingSchema != map.Schema && 
!CanBeDuplicated (existingSchema, map.Schema))
                {
                                throw new InvalidOperationException("The 
namespace '" + targetNs +"' defined by the class '" + map.TypeFullName + "' is 
a duplicate.");
                }
                }
 
+               private static bool CanBeDuplicated(XmlSchema existingSchema, 
XmlSchema schema)
+               {
+                       if(XmlSchemas.IsDataSet(existingSchema) && 
XmlSchemas.IsDataSet(schema)
+                               && existingSchema.Id == schema.Id)
+                               return true;
+                       return false;
+               }
+
                void ExportClassSchema (XmlTypeMapping map)
                {
                        if (IsMapExported (map)) return;

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

Reply via email to