Author: kostat
Date: 2007-09-25 11:30:45 -0400 (Tue, 25 Sep 2007)
New Revision: 86338

Modified:
   branches/mainsoft/gh20/mcs_Customer1/class/System.Data/System.Data/DataSet.cs
   
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/Test/System.Data/DataSetTest.cs
Log:
merge -r 86325:86326

Modified: 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/System.Data/DataSet.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/System.Data/DataSet.cs   
    2007-09-25 15:28:09 UTC (rev 86337)
+++ 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/System.Data/DataSet.cs   
    2007-09-25 15:30:45 UTC (rev 86338)
@@ -1767,9 +1767,9 @@
                internal static void WriteAttributeString (XmlWriter writer, 
XmlWriteMode mode, string nspc, string prefix, string name, string stringValue)
                {
                        switch ( mode) {
-                               case XmlWriteMode.WriteSchema:
-                                       writer.WriteAttributeString (prefix, 
name, nspc);
-                                       break;
+                       //      case XmlWriteMode.WriteSchema:
+                       //              writer.WriteAttributeString (prefix, 
name, nspc);
+                       //              break;
                                case XmlWriteMode.DiffGram:
                                        writer.WriteAttributeString (prefix, 
name, nspc,stringValue);
                                        break;

Modified: 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/Test/System.Data/DataSetTest.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/Test/System.Data/DataSetTest.cs
      2007-09-25 15:28:09 UTC (rev 86337)
+++ 
branches/mainsoft/gh20/mcs_Customer1/class/System.Data/Test/System.Data/DataSetTest.cs
      2007-09-25 15:30:45 UTC (rev 86338)
@@ -2019,6 +2019,41 @@
                }
 
                [Test]
+               public void WriteXmlModeSchema1 () {
+                       string SerializedDataTable =
+@"<rdData>
+  <MyDataTable CustomerID='VINET' CompanyName='Vins et alcools Chevalier' 
ContactName='Paul Henriot' />
+</rdData>";
+                       string expected =
+@"<rdData>
+  <xs:schema id=""rdData"" xmlns="""" 
xmlns:xs=""http://www.w3.org/2001/XMLSchema""; 
xmlns:msdata=""urn:schemas-microsoft-com:xml-msdata"">
+    <xs:element name=""rdData"" msdata:IsDataSet=""true"" 
msdata:UseCurrentLocale=""true"">
+      <xs:complexType>
+        <xs:choice minOccurs=""0"" maxOccurs=""unbounded"">
+          <xs:element name=""MyDataTable"">
+            <xs:complexType>
+              <xs:attribute name=""CustomerID"" type=""xs:string"" />
+              <xs:attribute name=""CompanyName"" type=""xs:string"" />
+              <xs:attribute name=""ContactName"" type=""xs:string"" />
+            </xs:complexType>
+          </xs:element>
+        </xs:choice>
+      </xs:complexType>
+    </xs:element>
+  </xs:schema>
+  <MyDataTable CustomerID=""VINET"" CompanyName=""Vins et alcools Chevalier"" 
ContactName=""Paul Henriot"" />
+</rdData>";
+                       DataSet set;
+                       set = new DataSet ();
+                       set.ReadXml (new StringReader (SerializedDataTable));
+
+                       StringWriter w = new StringWriter ();
+                       set.WriteXml (w, XmlWriteMode.WriteSchema);
+                       string result = w.ToString ();
+                       Assert.AreEqual (result.Replace ("\r", ""), 
expected.Replace ("\r", ""));
+               }
+
+               [Test]
                public void DeserializeModifiedDataSet ()
                 {
                         // Serialization begins

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

Reply via email to