A convenient compact syntax
-
Compact, familiar
While RELAX NG has an XML syntax, it also supports a compact syntax that's generally easier
to edit. RELAX NG Compact Syntax uses some abbreviations and conventions from DTDs, minus the angle
brackets, and is generally readable to anyone who's worked with DTDs before.
-
Declarations look like declarations.
name=element name{element givenName, element familyName}
-
DTD modifiers work as expected.
? for zero or one, * for zero or more, comma for sequence,
| for or, plus (like SGML) & for interleave.
book=element book {title, author+, license?, chapter+, appendix*}
-
Can use WXS Datatypes
RELAX NG supports WXS datatypes (technically, libraries are pluggable), so using datatypes
in declarations is easy:
number=element number {xsd:integer}
-
A start pattern
Neither DTDs nor WXS provide a means of identifying which element should be the root element
of a document - even as a suggestion. RELAX NG provides a convenient start pattern for this as well.
Previous Page <
TOC
> Next Page