TREX: a language to describe XML document structure
16:06, 8 Jan 2001 UTC | Eric van der Vlist

James Clark has announced  Tree Regular Expressions for XML (TREX) a new simple and flexible schema language focusing on the structure of XML documents.

The new language is an attempt to define the tree structure of XML documents without describing the data types or modifying anything in its infoset:

Calling it 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.

James Clark also mentions that "TREX expects to partner with a datatyping language, such as XML Schema Part 2: Datatypes".

TREX appears then as an alternative to W3C XML Schema Part 1.

Interestingly, some issues on which James Clark had expressed his disapproval are addressed by TREX which includes some highly flexible features such as:

  • Attributes can be defined before, after or between elements.
  • Choices between elements and attributes can be defined (a feature that might help defining RDF TREX schemas).
  • Choices between elements and PCDATA can be defined (a feature needed to define a schema for XSLT).
  • Unordered element sequences can be defined without much restriction.

The TREX specification is available with a tutorial, a sample Java implementation, a stylesheet to convert Relax schemas into TREX and TREX schemas including those for TREX, XSLT1.0, Relax Core and Xlink.

Other stories:

xmlhack: developer news from the XML community

Front page | Search | Find XML jobs

Related categories