The OASIS RELAX NG Technical Committee has released a committee specification for RELAX NG Compact Syntax. Edited by James Clark, the committee specification describes a compact, non-XML syntax for the RELAX NG Specification (OASIS Committee Specification 3-December-2001). The compact syntax is specified by a grammar in BNF; the translation into the XML syntax is specified by annotations in the grammar. "The goals of this compact syntax are to: (1) maximize readability; (2) support all features of RELAX NG -- it must be possible to translate a schema from the XML syntax to the compact syntax and back without losing significant information; (3) support separate translation -- a RELAX NG schema may be spread amongst multiple files, it must be possible to represent each of the files separately in the compact syntax, and the representation of each file must not depend on the other files. The compact syntax has similarities to W3C XQuery 1.0 Formal Semantics, to Regular Expression Types for XML (XDuce), and to the DTD syntax of XML 1.0. The body of the document contains an informal description of the syntax and how it maps onto the XML syntax. Developers should consult Appendix A for a complete, rigorous description. The non-normative Appendix B presents an example compact syntax RELAX NG schema for RELAX NG."
Bibliographic information: RELAX NG Compact Syntax. OASIS Committee Specification 21-November-2002. Edited by James Clark. Copyright (c) The Organization for the Advancement of Structured Information Standards [OASIS] 2002.
Note of 2002-11-21 from John Cowan to XML-DEV: "The compact syntax of RELAX NG (the one that isn't the XML syntax) has just become a Committee Draft. This is essentially like a W3C Candidate Recommendation; the next step is OASIS Recommendation, which requires three implementations by OASIS members plus the usual paperwork. There is also every reason to think that the compact syntax will become part of the ISO DSDL standard as well. This is good stuff, people. Rejoice..."
James Clark has produced tools for use with the RELAX NG Compact Syntax:
- Jing will validate using the compact syntax when the -c option is used
- Trang can translate schemas written in the compact syntax; in particular, trang can be used to translate schemas written in the compact syntax into the standard RELAX NG XML syntax
RELAX NG description from John Cowan's Tutorial "RELAX NG: DTDs on Warp Drive," to be given Monday December 9, 2002 at XML 2002:
RELAX NG allows easy and intuitive descriptions of just what is and what is not allowed in an XML document. It is simple enough to learn in a few hours, and rich and flexible enough to support the design and validation of every kind of document from the very simple to the very complex. Once RELAX NG's concepts have crossed the blood-brain barrier, you will never be able to take any other schema language seriously again.
RELAX NG is an evolution and generalization of XML DTDs, and it shares the same basic paradigm. Based on experience with SGML and XML, RELAX NG both adds and subtracts features from DTDs. XML DTDs can be automatically converted into RELAX NG. Experts in designing SGML and XML DTDs will find their skills transfer easily to designing RELAX NG. Design patterns that are used in XML DTDs can be used in RELAX NG. Overall, RELAX NG is much more mature (and it is possible to have a higher degree of confidence in its design) than it would be if it were based on a completely new and different paradigm.
A major goal of RELAX NG is that it be easy to learn and easy to use. Schemas can be patterned after the structure of the documents they describe, but need not be: definitions to be composed from other definitions in a variety of ways. Attributes and elements are treated uniformly as much as possible. RELAX NG supports pluggable simple datatype libraries, from a trivial one that describes only strings and tokens to the full XML Schema Part 2; new ones can be readily designed and built as needed. RELAX NG provides full support for namespaces. RELAX NG provides two interconvertible syntaxes, an XML one for processing, and a compact non-XML one for human authoring.
RELAX NG is being standardized in OASIS by the RELAX NG Technical Committee, and is a major component of ISO DSDL, the Document Schema Definition Languages umbrella.
On 2002-11-22 David Rosenborg (Pantor Engineering AB) announced the availability of "RELAX NG Compact Syntax Utilities." From XML-DEV: "I have made three utilities for the RELAX NG Compact Syntax available for public use: (1) an Emacs mode for editing in the compact syntax [minor emacs mode; just a beta; the indentation function needs some improvement]; (2) RngToRnc.xsl: an XSLT stylesheet that transforms from the XML syntax to the compact syntax; (3) RncReader: a SAX2 parser that reads a compact syntax schema and sends events to the application as if it was reading a schema in the XML syntax. By using this package, it's easy to add compact syntax support to a Java application. The reader can also work as a simple command line converter; see the supplied readme.txt for details. The utilities are available for download under a BSD license.
- RELAX NG Compact Syntax. Committee Specification 21-November-2002.
- OASIS RELAX NG Technical Committee website
- RELAX NG Resources from Thai Open Source Software Center (James Clark)
- Archived RELAX NG Technical Committee documents
- Mailing list archives for 'relax-ng' TC list
- Comments: send email to email@example.com; the list archives are online.
- Errata listing
- "RELAX NG Published as ISO/IEC DIS 19757-2 (DSDL Part 2)." See this Part 2 of Document Schema Definition Language (DSDL) in PDF. News item 2002-05-24.
- Thai Open Source Software Center Ltd. See also James Clark's Home Page.
- Note: "RELAX NG: DTDs on Warp Drive". 2002-12-09 tutorial by John Cowan.
- "RELAX NG" - Main reference page.