I though it would be useful to summarize some of what I shared with him.
Wiki page about generating a relax NG OTrunk schema and using it in a
validating XML editor to edit OTrunk documents:
http://confluence.concord.org/display/CSP/OTrunk+Schemas
In the otrunk project is a class called RNGSchemaGenerator and a
launcher in the schema/ folder in the otrunk project will run this
and generate schema's of different types (you need to edit and
re-compile RNGSchemaGenerator.java to produce the different schemas).
This link references earlier posts about using RNGSchemaGenerator
RNGSchemaGenerator.java uses the list of OTrunk model classes
generated by this simple ruby file:
schema/collect_imports.rb
Which produces a unique list of all the otrunk imports in all the
otrunk-examples:
/tmp/all-otrunk.xml
That is assuming you also have the otrunk-examples dir structure checked out.
Here's the result of running this today on my local working copy:
What's important to realize is that the schema generation is based on
the set of models used in the examples. If an OTrunk model exists
that is not used anywhere in otrunk-examples it will not be processed
as part of the schema generation.
Additionally some of the otml documents in otrunk-examples are old
and refer to classes that no longer exist (or don't exist for me
locally). These kind of errors are shown in the Eclipse console: