Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSD2 code generation failed #11

Open
R0l1I3S opened this issue Jul 24, 2019 · 2 comments
Open

XSD2 code generation failed #11

R0l1I3S opened this issue Jul 24, 2019 · 2 comments

Comments

@R0l1I3S
Copy link

R0l1I3S commented Jul 24, 2019

The execution of the command

"<PATH_TO_XSD2.exe>\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
Copy link
Contributor

meirkr commented Jun 6, 2020

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

@javiernaturalvox
Copy link

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
<xs:import namespace="http://datex2.eu/schema/3/trafficRegulation" schemaLocation="DATEXII_3_TrafficRegulation.xsd"/>

Could I merge all XSD files in one? How?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants