RELAX NG is not a capitalized misspelling of something you probably get to do all too rarely as a busy programmer and web designer. If you use XML to any great degree, you'll want to take a close look at it. It can help make your life as a web developer easier, allowing you to relax a little more. Keep reading to learn what it is, and the advantages to using it. This is the first part of a three-part series.
RELAX NG is one of several schema languages available for XML. Based on RELAX (REgular LAnguage description for XML) and TREX (Tree Regular Expressions for XML), RELAX NG offers a nice alternative to W3C-recommended XML Schema. RELAX NG aims to be a simple and easy-to-use language, and, perhaps as a result of this, it has become quite popular. In this article, we'll take a look at RELAX NG and some of the features it provides.
One of the most interesting things about RELAX NG is that it actually has two syntaxes. Either syntax can be used to create a schema definition, and the same results can be achieved.
The first syntax is an XML-based syntax, which, of course, makes sense because RELAX NG is, after all, a schema language for XML. However, describing something with XML doesn't always produce a concise result. XML's structure often lends itself to verbose results.
The second syntax is very different. It's called the “compact syntax.” It's not based on XML, and it can create some pretty concise results while still being very readable.
Rather than expand on the merits of both syntaxes and steer you one way or the other, I'll leave you to decide which syntax to use for your projects. This article will cover both syntaxes.