[Mono-bugs] [Bug 60470][Wis] Changed - Exception thrown when infering Xml Schema to DataSet

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Jun 2004 14:26:23 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by pbaena@uol.com.ar.

http://bugzilla.ximian.com/show_bug.cgi?id=60470

--- shadow/60470	2004-06-21 00:37:03.000000000 -0400
+++ shadow/60470.tmp.25667	2004-06-22 14:26:22.000000000 -0400
@@ -122,6 +122,85 @@
 not behave as they expected, since InferXmlSchema () looks like
 successfully done (but in fact it never infers any structures). It is
 impossible to support DataSet to handle schema document, unless it is
 designed to use namespace alias such like XSLT does.
 
 I hope this clarifies the way I fixed would be better than what MS does.
+
+------- Additional Comments From pbaena@uol.com.ar  2004-06-22 14:26 -------
+Is this related?  
+  
+Usuarios.xml:  
+  
+<myData>  
+  <xs:schema id="myData" xmlns=""  
+xmlns:xs="http://www.w3.org/2001/XMLSchema"  
+xmlns:msdata="urn:schemas-microsoft-com:xml-m  
+sdata">  
+    <xs:element name="myData" msdata:IsDataSet="true">  
+      <xs:complexType>  
+        <xs:choice maxOccurs="unbounded">  
+          <xs:element name="myTable">  
+            <xs:complexType>  
+              <xs:sequence>  
+                <xs:element name="id" msdata:AutoIncrement="true"  
+type="xs:int" minOccurs="0" />  
+                <xs:element name="nombre" type="xs:string"  
+minOccurs="0" />  
+                <xs:element name="telefono" type="xs:string"  
+minOccurs="0" />  
+                <xs:element name="email" type="xs:string"  
+minOccurs="0" />  
+                <xs:element name="password" type="xs:string"  
+minOccurs="0" />  
+              </xs:sequence>  
+            </xs:complexType>  
+          </xs:element>  
+        </xs:choice>  
+      </xs:complexType>  
+    </xs:element>  
+  </xs:schema>  
+  <myTable>  
+    <id>0</id>  
+    <nombre>test</nombre>  
+    <telefono>ssss</telefono>  
+    <email>sadwras</email>  
+    <password>adsdasd</password>  
+  </myTable>  
+  <myTable>  
+    <id>1</id>  
+    <nombre>asds</nombre>  
+    <telefono>23123</telefono>  
+    <email>wesadds</email>  
+    <password>qweqwe</password>  
+  </myTable>  
+</myData>  
+  
+  
+With this code:  
+  
+using System;  
+using System.Data;  
+using System.IO;  
+  
+class Test {  
+  
+        public static void Main ()  
+        {  
+                DataSet ds = new DataSet();  
+                FileStream fs = new FileStream("Usuarios.xml",  
+                        FileMode.Open, FileAccess.Read,  
+FileShare.Read);  
+                StreamReader reader = new StreamReader(fs);  
+                ds.ReadXml(reader, XmlReadMode.ReadSchema);  
+                fs.Close();  
+  
+                Console.WriteLine (ds.GetXml ());  
+        }  
+  
+}  
+  
+  
+  
+Shows a <NewDataSet />  
+  
+Whereas on .NET it throws a dataset filled with the elements.