Hi,

I'm trying to read a schema for a DataSet form an XSD file, which causes an error. The behavior is different in MS .NET 2.0 and Mono (tried both 1.1.17.1 and 1.1.13.8 under Linux x64, both fc5 and OpenSUSE 10.1): both gmcs and Windows csc compiled binaries work OK in Windows (Vista RC1) and both fail on Linux. The error given is:

Reading XML schema...

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at System.Data.XmlSchemaDataImporter.CreateChildColumn (System.Data.DataColumn parentColumn, System.Data.DataTable childTable) [0x00000]
  at System.Data.XmlSchemaDataImporter.GenerateRelationship (System.Data.RelationStructure rs) [0x00000]
  at System.Data.XmlSchemaDataImporter.Process () [0x00000]
  at System.Data.DataSet.ReadXmlSchema (System.Xml.XmlReader reader) [0x00000]
  at System.Data.DataSet.ReadXmlSchema (System.String str) [0x00000]
  at ConsoleApplication1.Program.Main (System.String[] args) [0x00000]


The same error is produced with Mono's "xsd -d". The lines causing the error (in runtime) in the C# application are as follows:

            Console.WriteLine("Reading XML schema...");
            DataSet ds = new DataSet();
            ds.ReadXmlSchema("qstat.xsd");
===> Execution generated here.

The XSD fie I'm using is available at
http://gridengine.sunsource.net/source/browse/*checkout*/gridengine/source/dist/util/resources/schemas/qstat/qstat.xsd?rev=1.8

Only one change is required to be used as a Dataset schema: comment out line 159:
<xs:attribute name="state" type="xs:string" use="required"/>
(This would generate a second column name state on the same Table in the Dataset; the XSD schema is validated to be OK in Altova's XMLSpy)

My question is that is this error known by the Mono developer team and could anyone have any suggestion for a way to fix / circumvent this?

Juha


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

Reply via email to