Relaxing into 2002

By Sean McGrath, ITworld |  How-to

From time-to-time, a markup technology comes along without much fanfare
that really changes the way we think about and build XML systems. The
SAX API, developed under the tutelage of David Megginson on the XML-DEV
mailing list, springs to mind. Without a big brouhaha or marketing
budget, without the imprimatur of any august institution or consortium,
SAX has quietly become an indispensable part of the XML application
development landscape.

I strongly suspect that RELAX NG (http://www.RELAX NG.org) is following
in the footsteps of SAX. SAX was a humble blend of simplicity and
pragmatism aimed at providing an event-oriented API for XML processing.
Similarly, RELAX NG is a humble blend of simplicity and pragmatism
aimed at providing a validation system for XML documents.

RELAX NG schemas are themselves XML documents. Now those of you who
work with XSLT know that can be a mixed blessing. On one hand, you can
throw all your XML processing tools at them; on the other hand, they
can be somewhat legibility challenged.

RELAX NG is a pure delight in this regard, being truly readable after
an hour or two of practice. Furthermore, you can intermingle your own
markup at will into a RELAX NG schema, which makes adding your own
annotations for documentation and module maintenance very simple.
Anyone familiar with DTDs that wish to play around with Relax should
get DTDinst (http://www.thaiopensource.com/dtdinst/), a Java based tool
that converts DTDs into RELAX NG notation.

RELAX NG focused on validation; it does not concern itself with
modifying the validated document in any way. DTDs allow you to do that,
particularly by using default attribute values. This and some
other "omissions" from RELAX NG are, in fact, improvements. DTDs suffer
from doing more than specify validation rules; they also get involved
in conditional inclusion, macro expansion, and data-typing to name but
three. RELAX NG leaves these out, finally creating a clean separation
between validation and all these other XML processing features that can
be -- as they should be -- implemented in separate layers.

The conciseness and remarkable brevity (given its XML syntax) of RELAX
NG reminds me of the phrase, variously attributed to Shaw, Russell, and
Pascal: "Please excuse the length of this letter; I do not have time to
be brief.". The designers of RELAX NG (principally James Clark and
MURATA Makoto) have taken the time to be brief. The syntax is clearly
the result of a lot of thought and effort.

Most impressive of all is the fact that this combination of brevity and
power is not at the expense of formalism and rigor, which underlies
RELAX NG in abundance. The full details are available on the Oasis site
(http://www.oasis-open.org/committees/relax-ng/spec-20011203.html)
where work on RELAX NG continues.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Ask a Question
randomness