I have an application into which users can upload an XSD to describe certain kinds of user data. The application needs to parse this XSD to correctly initialise various bits of database metadata (e.g. translating xs:enumerations into lists of permitted values that will populate drop-down lists). The same user-entered XSD is also used to validate XML documents sent to the application by other systems.
Is it possible to write a master XSD against which I can validate such a user-supplied XSD so that I can limit how users can describe their data and therefore make the job of XSD parsing easier? For example, let's say I wanted to be able to allow users to upload any XSD at all unless it contained xs:union tags. How could I write an XSD that I could use to validate an XSD uploaded by the user to enforce this rule?