Untangling Schema includes by ignoring included includes

I do more than a bit of work on refactoring people's large sets of
Schemas, and includes/imports are a real issue.  It's way too easy to  
end
up with cyclic dependencies between Schemas, and once that happens, the
coupled Schemas are effectively like one big Schema (which typically is
not what you wanted if you have gone to the trouble of having separate
Schema files).

The problem is that when includes have includes have includes, etc., it
makes it difficult for anyone working on the Schemas to realise just  
what
the dependencies actually are.  I would like to suggest a simple  
mechanism
that would help overcome this.

If the xs:include and xs:import elements had a boolean flag that  
indicated
"do not include/import further Schemas included/imported in this Schema"
(with a default of 'false'), then with that flag set to 'true'  
everywhere,
each Schema would be forced to have explicit declarations for each
include/import that it depends on.  That would make large sets of  
Schemas
easier to manage.

Some people try to do something similar by using incomplete Schema files
that don't have the includes they need in them, leaving the includes for
the higher-level including (parent) Schemas to manage.  However, this
doesn't work well with XML editors that can validate Schemas, since  
these
lower-level Schemas-without-includes aren't complete and won't validate.
My solution allows each Schema to be properly validatable.

Comments?  I think this is a small change with no backwards  
compatibility
issues, but one that would help with the manageability of Schemas.

Cheers, Tony.

Anthony B. Coates, Senior Partner, Miley Watts LLP.

Received on Saturday, 15 July 2006 17:32:24 UTC