Tom --
I asked about this a while back, actually:
http://lists.xml.org/archives/xml-dev/200206/msg00905.html
The situation here was a schema that was built from X.12 EDI
(http://www.tranxml.org) but where self-contained, minimal schemae for
different document elements was desired. (The results are part of the
4.0 release.)
I ended up with a stylesheet combination that first merged the total
includes together into a holder document and then ran multiple passes
that simplified the document by pulling types into a bucket that would
eventually contain the final schema. Several passes were required but
produced a workable self-contained, minmal schema for the desired type.
I am happy to share the stylesheets if they would be useful. I would
not, however, consider them to be much more than a start.
I definitely agree with Joseph's vision of being able to assemble a
schema from a registry of atoms.
Cheers,
Paul B
Http://radio.weblogs.com/0119894