codaxy / xsd2

Improved version of xsd.exe
MIT License
34 stars 21 forks source link

XSD2 code generation failed #11

Open R0l1I3S opened 5 years ago

R0l1I3S commented 5 years ago

The execution of the command

"\Xsd2.exe" ^ INSPIRE_LU_PLANNED\BaseTypes.xsd ^ INSPIRE_LU_PLANNED\BaseTypes2.xsd ^ INSPIRE_LU_PLANNED\LandUseNomenclature.xsd ^ INSPIRE_LU_PLANNED\xlink\1.0.0\xlinks.xsd ^ INSPIRE_LU_PLANNED\gml\3.2.1\gml.xsd ^ INSPIRE_LU_PLANNED\gml\3.3\extdEncRule.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gmd\gmd.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gco\gco.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gmx\gmx.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gss\gss.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gts\gts.xsd ^ INSPIRE_LU_PLANNED\iso\19139\20070417\gsr\gsr.xsd ^ INSPIRE_LU_PLANNED\Sonstiges\Addresses.xsd ^ INSPIRE_LU_PLANNED\Sonstiges\GeographicalNames.xsd ^ INSPIRE_LU_PLANNED\PlannedLandUse.xsd ^ @pause

within a batch file leads to the following error message:

C:\Daten\xxx\INSPIRE_LU_PLANNED\BaseTypes.xsd C:\Daten\xxx\INSPIRE_LU_PLANNED\BaseTypes.cs XSD2 code generation failed. System.Xml.Schema.XmlSchemaException: Nicht definiertes 'complexType' 'http://www.opengis.net/gml/3.2:AbstractFeatureType' wird als Basis für die Erweiterung des komplexen Typs verwendet. bei System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) bei System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) bei System.Xml.Schema.Compiler.CompileComplexContentExtension(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension) bei System.Xml.Schema.Compiler.CompileComplexType(XmlSchemaComplexType complexType) bei System.Xml.Schema.Compiler.Compile() bei System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) bei System.Xml.Schema.XmlSchemaSet.Compile() bei System.Xml.Serialization.XmlSchemas.Compile(ValidationEventHandler handler, Boolean fullCompile) bei Xsd2.XsdCodeGenerator.Generate(IList`1 schemas, TextWriter output) in C:\Users\xxx\Downloads\xsd2-master\Xsd2\XsdCodeGenerator.cs:Zeile 79. bei Xsd2.Program.Main(String[] args) in C:\Users\xxx\Downloads\xsd2-master\Xsd2\Program.cs:Zeile 131.

That means there is a 'complexType' which is not defined and which is used as a base for the extension of the complex type.

The files I used above can be found here:

INSPIRE_LU_PLANNED.zip

Is this behaviour a bug or do I have to use other options of xsd2.exe to successfully generate C# or VB .NET classes from the xsd files?

meirkr commented 4 years ago

Hi Still having this issue? Have you tried generating only a single xsd file?

javiernaturalvox commented 9 months ago

Hi I have same issue.

I want generate C# classes from several xsd downloaded to one local directory. All XSD files are in https://datex2.eu/schema/3/

I think the problem is because each XSD file have several references to other XSD files and the error is 'complexType' which is not defined. Example reference to

Could I merge all XSD files in one? How?

Thanks