Restricting XML Schema.

admin

Administrator
Staff member
Hi,

I'm working with a large third-party XML Schema, defined over 40+ XSD files. All the components and fields referenced in the Schema are listed in two specific XSDs, which are then included at the top of every file.

We want to limit instance documents to a subset of the Schema. This means removing about twenty-five of the XSDs and commenting out their includes in the top level Schema.

However, we also want to generate a database schema based on our limited set of instances. When we do this automatically, we bring in all the thousands of elements and attributes listed in the components and fields Schema, whether they are then referenced by our chosen instance types or not.

As I see it, the generation tools are effectively reading the Schema from bottom-up, whereas validation is performed top-down.

My questions are:-

Is there an easy way to identify all 'orphan' definitions and exclude them from the Schema?

...or...

Is there a way or a tool we can use to cut new Schema, including only the items referenced in our specific list of types?

We might want to add some instance types back in later, so I don't want to end up with a huge manual maintenance overhead.

Thanks for any help or suggestions.

J.
 
Back
Top