Tool that can combine many XSD files into one?

What you can do is to create another new file called file.xsd containing all the schema names in it and then the trick is to name the last schema file with .\ as prefix.

File.xsd

<xsd xmlns="http://microsoft.com/dotnet/tools/xsd/">
    <generateClasses language="CS" namespace="MyNamespace">
        <schema>First.xsd</schema>
        <schema>Second.xsd</schema>
        <!-- more schema files here -->
        <schema>.\Third.xsd</schema>
    </generateClasses>
</xsd>

Now run the command “xsd.exe /p:file.xsd /classes” and you get the class file generated 🙂

Leave a Comment