Information AboutRelax Ng |
| CATEGORIES ABOUT RELAX NG | |
| iso standards | |
| xml-based standards | |
| data modeling languages | |
| 2001 introductions | |
|
It is defined by a committee specification of the ). SCHEMA EXAMPLES Suppose we want to define an extremely simple XML markup scheme for a book: a book is defined as a sequence of one or more pages; each page contains text only. A sample XML document instance might be: XML syntax A RELAX NG schema can be written in " Russian Doll " structure by defining a root element that contains further element definitions, which may themselves contain embedded definitions. A schema for our book in this style, using the full XML syntax, would be written: Russian-doll structure becomes unwieldy with many sublevels and cannot define recursive elements, so most complex RELAX NG schemas use references to ''named pattern'' definitions located separately in the schema. Here, a "flattened schema" defines precisely the same book markup as the previous example: Compact syntax RELAX NG compact syntax is a non-XML format designed so that it can be unambiguously translated to its XML counterpart, and back again, with one-to-one correspondence in structure and meaning, in much the same way that Simple Outline XML (SOX) relates to XML . It shares many features with the syntax of DTD s. Here is the compact form of the Russian-doll schema: start = element book { element page { text }+ } By using named patterns, this can be flattened to: start = element book { page+ } page = element page { text } A compact RELAX NG parser will treat these two as the same pattern. COMPARISON WITH W3C XML SCHEMA See Also: XML Schema Language Comparison Although the RELAX NG specification was developed at roughly the same time as the W3C XML Schema specification, the latter was arguably better known and more widely implemented in both open-source and commercial XML parsers and editors when it became a W3C Recommendation in 2001. Since then, however, RELAX NG support has increasingly found its way into XML software, and its acceptance has been aided by its adoption as a primary schema for popular docucentric markup languages such as DocBook , the TEI Guidelines, and OpenDocument . RELAX NG shares with W3C XML Schema many features that set both apart from traditional , Regular Expression support, Namespace support, ability to reference complex definitions. FILENAME EXTENSIONS By informal convention, RELAX NG schemas in the regular syntax are typically named with the Filename Extension ".rng". For schemas in the compact syntax, the extension ".rnc" is used. SEE ALSO
EXTERNAL LINKS
|
|
|