|

Want
to Transition from DTDs to XML Schemas?
Just RELAX!
One of the papers to be
presented at XTech at the end of February focuses on
RELAX (REgular LAnguage for XML).. RELAX is a
language for representing regular sets of XML
documents as grammars. According to the presentor,
Murata Makoto, A RELAX grammar generates a set of XML
documents. Conversely, XML documents can be validated
against a RELAX grammar. RELAX consists of RELAX core
and RELAX Namespace. RELAX core provides modules,
which declare and constrain elements and attributes in
a single namespace." The XTech
presentation will focus on RELAX core.
RELAX is being
positioned as a transition path from traditional XML
DTDs to XML Schemas. When RELAX is compared with
a traditional DTD (Document Type Definition), we see
that RELAX has new features that DTDs do not have:
- A
RELAX grammar can be written as an XML document.
- RELAX
borrows rich datatypes of XML Schema Part 2.
- RELAX
is namespace-aware.
RELAX is more
expressive than DTD in representing structural
constraints on elements and attributes. RELAX,
however, does not provide mechanisms for declaring
entities, notations, and default values, which have
been captured by DTDs. Rather, RELAX is intended to be
used in conjunction with DTD. A RELAX grammer is
made up of one or more modules. A RELAX module
consists of rules (corresponding to element type
declarations) and patterns (corresponding to attribute
list declarations).
Perhaps the biggest
question about RELAX is why do we need it.
Doesn't RELAX provide some of what XML Schema
Definition Language is supposed to provide? When
is RELAX useful? Why not just wait for the W3C
XML Schema Definition Language? These questions
are answered in
the FAQ page of the RELAX
Web site:
- The
scope of XML Schema is very broad. Thus, its
standarization, implementation and adoption require a
relatively long time. Furthermore, to take full
advantage of XML Schema, extensions to DOM and SAX are
required.
- On
the other hand, RELAX is much more modest. Thus, it is
easier to standardize, implement, and adopt. RELAX is
a combination of (1) features of DTD, and (2) rich
datatypes of XML Schema represented in the XML syntax.
RELAX also has some other mechanisms, but they have
been eliminated from the conformance level
"classic".
- RELAX
helps migration from DTD to XML Schema. You can assume
that RELAX is DTD combined with datatype information
in the XML instance syntax and start to use RELAX
right now. When XML Schema is available, migration
from RELAX to XML Schema will be possible without loss
of datatype information.
Will
RELAX be used? Only time will tell. It
certainly seems that the upward compatibility with
DTDs will be helpful from those of us already using
either XML or SGML DTDs. Keep an eye on RELAX
and visit the RELAX
Web site for
more information.
Return
to TOC
|