[Mono-bugs] [Bug 53959][Cri] New - MONO 0.30 DataSet problem round-tripping XML (Schema Inference Issue)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 5 Feb 2004 19:08:58 -0500 (EST)


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 davidandrewtaylor@hotmail.com.

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

--- shadow/53959	2004-02-05 19:08:58.000000000 -0500
+++ shadow/53959.tmp.31926	2004-02-05 19:08:58.000000000 -0500
@@ -0,0 +1,126 @@
+Bug#: 53959
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: davidandrewtaylor@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MONO 0.30 DataSet problem round-tripping XML (Schema Inference Issue)
+
+Description of Problem:
+MONO 0.30: If I use ReadXml(input.txt) and then immediately call WriteXml
+(output.txt), the output format is incorrect.  Certain XML attributes 
+have been modified to be XML elements.  This appears to be a problem with 
+the MONO DataSet attempting to infer the XML schema as when I call 
+GetSchema() the schema is incorrect.
+
+Steps to reproduce the problem:'
+// Try running this simple program
+using System;
+using System.Data;
+
+public class test
+{
+    public static void Main()
+    {
+        DataSet ds = new DataSet();
+        ds.ReadXml("input.txt");       
+        ds.WriteXml("output.txt");
+    }
+}
+
+Input XML File (input.txt):
+<?xml version="1.0" standalone="yes"?>
+<FullTextResponse>
+  <Domains>
+    <AvailResponse info="y" name="novell-ximian-group" />
+    <AvailResponse info="n" name="ximian" />
+  </Domains>
+</FullTextResponse>
+
+MS.NET 1.1 Output (output.txt):
+<?xml version="1.0" standalone="yes"?>
+<FullTextResponse>
+  <Domains>
+    <AvailResponse info="y" name="novell-ximian-group" />
+    <AvailResponse info="n" name="ximian" />
+  </Domains>
+</FullTextResponse>
+
+MONO 0.30 Output (output.txt) - Which is obviously incorrect:
+<?xml version="1.0" standalone="yes"?>
+<FullTextResponse>
+  <Domains>
+    <AvailResponse>
+      <info>y</info>
+      <name>novell-ximian-group</name>
+    </AvailResponse>
+    <AvailResponse>
+      <info>n</info>
+      <name>ximian</name>
+    </AvailResponse>
+  </Domains>
+</FullTextResponse>
+
+
+MS.NET 1.1 Inferred Schema:
+<xs:schema id="FullTextResponse" xmlns="" 
+xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
+microsoft-com:xml-msdata">
+<xs:element name="FullTextResponse" msdata:IsDataSet="true" 
+msdata:Locale="en-AU">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="Domains">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="AvailResponse" minOccurs="0" 
+maxOccurs="unbounded">
+                <xs:complexType>
+                  <xs:attribute name="info" type="xs:string" />
+                  <xs:attribute name="name" type="xs:string" />
+                </xs:complexType>
+              </xs:element>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+
+
+MONO 0.30 Inferred Schema
+<?xml version="1.0" encoding="utf-16"?>
+<xsd:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" 
+xmlns:xs="http://www.w3.org/2001/XMLSchema" id="FullTextResponse" 
+xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="FullTextResponse" msdata:IsDataSet="true" 
+msdata:Locale="">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="Domains">
+          <xs:complexType />
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="Constraint1">
+      <xs:selector xpath=".//Domains" />
+      <xs:field xpath="Domains_Id" />
+    </xs:unique>
+    <xs:keyref refer="Constraint1" name="Domains_AvailResponse" 
+msdata:IsNested="true">
+      <xs:selector xpath=".//AvailResponse" />
+      <xs:field xpath="Domains_Id" />
+    </xs:keyref>
+  </xs:element>
+</xsd:schema>