I've designed and implemented a small, simple schema language. It doesn't aim to assist in interpreting or processing the document. This is the first release, so there will certainly be bugs in both the documents and the implementation. I plan to continue to refine both the design and the implementation.
Input is welcome.
The TREX specification definitively describes the TREX language. An unordered collection of attributes and an ordered sequence of elements and characters are matched jointly against a pattern with respect to an environment. An environment is a mapping from names to patterns together with a possibly null reference to a parent environment. The result of matching is true or false. XML document is valid with respect to a TREX pattern if an empty collection of attributes and a sequence containing just the document element of the document matches the pattern with respect to an empty environment.