James Clark announced an updated sample implementation of TREX in Java. This implementation "now supports datatyping using a 'real implementation' of datatypes in W3C XML Schema Part 2; the datatyping implementation is independent of the rest of the sample implementation, so it might be useful for other applications of XML Schema Part 2. There's also a TREX task that allows the TREX sample implementation to be used conveniently from within Ant." The Version 2001-02-12 implementation is available for download as a JAR file and as a Win32 executable for use with the Microsoft Java VM. The source is also available.

TREX (Tree Regular Expressions for XML) "is a new language for validating XML documents." James Clark wrote: "Calling TREX a schema language is perhaps misleading: it's goal is purely validation. It doesn't aim to assist in interpreting or processing the document. The post-validation infoset is exactly the same as the pre-validation infoset. You can find more, including a tutorial, a (relatively) formal spec and a sample implementation in Java on top of SAX2 at http://www.thaiopensource.com/trex/. TREX is basically the type system of XDuce with an XML syntax and with a bunch of additional features (like support for attributes and namespaces) needed to make it a practical language for structure validation. Of existing Schema languages, it's closest to RELAX. It's not tied to any particular datatyping language; rather, the idea is that you can plug whatever datatyping language you want..." The specification says: "A TREX pattern specifies a pattern for the structure and content of an XML document. A TREX pattern thus identifies a class of XML documents consisting of those documents that match the pattern. A TREX pattern is itself an XML document..."

The main change is that it now supports datatyping using a real
implementation of XML Schema Part 2. This implementation supports
trex:role="datatype", so you can now +use xsd:list, xsd:union and
xsd:restriction to derive new datatypes within a TREX pattern. There are
a number of things not yet implemented (see
http://www.thaiopensource.com/trex/jdatatypes.html for details), some
because I just haven't got to them yet, some because I expect them to
change in the XML Schema Proposed Recommendation.

The datatyping implementation is independent of the rest of the
implementation, so it might be useful for other applications of XML
Schema Part 2.