I am looking for a programmatic solution to this, not asking about a tool.
Given a directory of XSD files with imports to other XSD files in that directory, I would like to verify all required imports are present and the XSDs are valid XML.
My current manual process:
This gives error messages if there are issues or missing files.
How files are imported:
<xs:import schemaLocation="Other.xsd" namespace="Foo"/>
I'm looking for an automated way to achieve this, preferably without the overhead of XML Spy, so that this can be integrated in an automated test.
This is not about validation XML instances based on those XSD files, only about validating the XSD files and their dependencies.
It depends on the platform your are on, on .NET (with XSD 1.0) you have good support for checking schemas with XmlSchemaSet
by loading/compiling them and checking for any warnings or errors, details are at https://learn.microsoft.com/en-us/dotnet/standard/data/xml/xmlschemaset-for-schema-compilation#compiling-schemas.
I think with Java there are different APIs but somehow similar functionality available.