[Mono-bugs] [Bug 67793][Nor] New - DataSet.GetXmlSchema() fails to write <xs:restriction> and <xs:maxLength> subelements when for a DataColumn with MappingType = Attribute and MaxLength = desired_length

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 7 Oct 2004 18:52:22 -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 dclough@prconline.com.

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

--- shadow/67793	2004-10-07 18:52:22.000000000 -0400
+++ shadow/67793.tmp.17702	2004-10-07 18:52:22.000000000 -0400
@@ -0,0 +1,83 @@
+Bug#: 67793
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: Fedora Core 2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dclough@prconline.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataSet.GetXmlSchema() fails to write <xs:restriction> and <xs:maxLength> subelements when for a DataColumn with MappingType = Attribute and MaxLength = desired_length
+
+Description of Problem:
+
+Paste the following code into a simple console app:
+
+DataSet ds = new DataSet("Example");
+
+// Add MyType DataTable
+ds.Tables.Add("MyType");
+
+ds.Tables["MyType"].Columns.Add(new DataColumn("Desc", typeof
+(string), "", MappingType.Attribute));
+ds.Tables["MyType"].Columns["Desc"].MaxLength = 32;
+
+ds.AcceptChanges();
+
+System.Console.WriteLine(ds.GetXmlSchema());
+
+Actual Results:
+
+<?xml version="1.0" standalone="yes"?>
+<xs:schema id="Example" xmlns="" 
+xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
+microsoft-com:xml-msdata">
+  <xs:element name="Example" msdata:IsDataSet="true">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="MyType">
+          <xs:complexType>
+            <xs:attribute name="Desc" />
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+
+Expected Results:
+
+<?xml version="1.0" standalone="yes"?>
+<xs:schema id="Example" xmlns="" 
+xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
+microsoft-com:xml-msdata">
+  <xs:element name="Example" msdata:IsDataSet="true">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="MyType">
+          <xs:complexType>
+            <xs:attribute name="Desc">
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="32" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:attribute>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
+
+
+How often does this happen?
+
+Repeatable with the above code.