How can I verify that one XSD schema is a subset of another XSD schema?
We are creating a system-of-systems application using a collection of \"blueprint\" XSD schemas (
Since currently there is no available solution of validating/checking schema against another schema, looks like we have to use workarounds. Below is my attempt.
Restating the problem:
Identify whether all the data types defined in a subset schema exists and are within the (less stricter) bounds of what is defined in a "blueprint" schema.
A possible solution:
So, using this knowledge, we can construct a solution:
Create all possible XML instances of a subset schema (doing this step programmatically can be a challenge), and validate these XML instances against the "blueprint" schema.
But how you know that the subset schema is a subset of a "blueprint" schema? Well, since you created all possible XML instances of a subset schema, it covered all the data types that are there in a subset schema. And validating these XML instances against the "blueprint" schema, inherently is checking whether the data types exists and all is within the bounds of what is defined in the "blueprint" schema. Hence, identifying that your subset schema is indeed a subset of a "blueprint" schema.
I know its not an ideal solution, but hope this helps given that there is no simple way available to do what you are asking.