Bug 34090 - mono's xsd tool generates invalid xsd
Summary: mono's xsd tool generates invalid xsd
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: XSD ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-19 18:16 UTC by Hin-Tak Leung
Modified: 2015-09-19 18:19 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
source xml file (389.30 KB, text/xml)
2015-09-19 18:16 UTC, Hin-Tak Leung
Details
The valid result that MS.net SDK xsd generates. (1.34 KB, application/octet-stream)
2015-09-19 18:18 UTC, Hin-Tak Leung
Details
The invalid result that mono xsd tool generates. (1.17 KB, application/octet-stream)
2015-09-19 18:19 UTC, Hin-Tak Leung
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 34090 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Hin-Tak Leung 2015-09-19 18:16:22 UTC
Created attachment 12980 [details]
source xml file

running 'xsd file.xml' generates an xsd files which is invalid.

The result subsequently causes 

Unhandled Exception:
System.Xml.Schema.XmlSchemaException: Element http://www.w3.org/2001/XMLSchema:sequence is invalid in this context.
The error occured on (15,14)
  at System.Xml.Schema.ValidationHandler.RaiseValidationEvent (System.Xml.Schema.ValidationEventHandler handle, System.Exception innerException, System.String message, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender, System.String sourceUri, XmlSeverityType severity) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message, System.Exception innerException, System.Xml.Schema.XmlSchemaObject xsobj, System.Object sender) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaObject.error (System.Xml.Schema.ValidationEventHandler handle, System.String message, System.Exception innerException) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaReader.RaiseInvalidElementError () [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaComplexType.Read (System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaElement.Read (System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaChoice.Read (System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaComplexType.Read (System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchemaElement.Read (System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchema.ReadContent (System.Xml.Schema.XmlSchema schema, System.Xml.Schema.XmlSchemaReader reader, System.Xml.Schema.ValidationEventHandler h) [0x00000] in <filename unknown>:0 
  at System.Xml.Schema.XmlSchema.Read (System.Xml.XmlReader reader, System.Xml.Schema.ValidationEventHandler validationEventHandler) [0x00000] in <filename unknown>:0 
...


MS.net SDK 's xsd tool generates an xsd which does not cause this.

this difference seems to be the order of items - complex type sould have attributes following sequence, I think.
Comment 1 Hin-Tak Leung 2015-09-19 18:18:16 UTC
Created attachment 12981 [details]
The valid result that MS.net SDK xsd generates.
Comment 2 Hin-Tak Leung 2015-09-19 18:19:17 UTC
Created attachment 12982 [details]
The invalid result that mono xsd tool generates.