Problem with translating XSD schemas to C# with include field

141 views Asked by At

I need to convert about 100 XSD schemas to C# classes. The problem is that I can't do it. I have never had to do with XSD schema. Some of these schemes have dependencies on others and this complicates things. I tried using the standard xsd tool for the given problem but it didn't help. When I transferred one file, it did not want to generate because of the include statements.

When I created the file with all my XSD schemas:

<xsd xmlns = 'http: //microsoft.com/dotnet/tools/xsd/'>
<generateClasses language = 'CS' namespace = 'Namespace.subnamespace'>
    <schema> BaseTypes.xsd </schema>
    ... (other schemas)
</generateClasses>
</xsd>

then I get an error:

Error generating classes for schema - Schema with targetNamespace = 'Mynamespace' has invalid syntax. The complexType 'AbstractFeature' has already been declared.

Although I know for sure that there is no invalid syntax, but it has cyclical dependencies.

I tried using LiquidStudio. It coped with the task, but at the end I did not get what I wanted (I want to get classes that are independent of third-party libraries in the output, as xsd.exe does).

I tried to use xsd2code ++ there, I did not find how to work with a large number of schemes, it also has problems in work sometimes it just generates an empty file if you exclude external dependencies, although inside there is data independent of external included data from which you need to generate a class.

0

There are 0 answers