computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, RELAX NG (REgular LAnguage for XML Next Generation) is a
schema
Schema may refer to:
Science and technology
* SCHEMA (bioinformatics), an algorithm used in protein engineering
* Schema (genetic algorithms), a set of programs or bit strings that have some genotypic similarity
* Schema.org, a web markup vocab ...
language for
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
—a RELAX NG schema specifies a pattern for the structure and content of an XML document. A RELAX NG schema is itself an
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
document but RELAX NG also offers a popular compact, non-XML syntax. Compared to other XML schema languages RELAX NG is considered relatively simple.
It was defined by a committee specification of the
OASIS
In ecology, an oasis (; : oases ) is a fertile area of a desert or semi-desert environmentMurata Makoto's RELAX and James Clark's TREX, and also by part two of the international standard
ISO
The International Organization for Standardization (ISO ; ; ) is an independent, non-governmental, international standard development organization composed of representatives from the national standards organizations of member countries.
Me ...
/ IEC 19757: Document Schema Definition Languages ( DSDL). ISO/IEC 19757-2 was developed by ISO/IEC JTC 1/SC 34 and published in its first version in 2003.
Comparison with W3C XML Schema
Although the RELAX NG specification was developed at roughly the same time as the W3C
XML Schema
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself. These constrai ...
specification, the latter was arguably better known and more widely implemented in both open-source and proprietary 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 document-centric markup languages such as
DocBook
DocBook is a Semantics (computer science), semantic markup language for technical documentation. It was originally intended for writing technical documents related to computer hardware and software, but it can be used for any other sort of docume ...
OpenDocument
The Open Document Format for Office Applications (ODF), also known as OpenDocument, standardized as ISO 26300, is an open file format for word processor, word processing documents, spreadsheets, Presentation program, presentations and ...
, and
EPUB
EPUB is an e-book file format that uses the ".epub" file extension. The term is short for ''electronic publication'' and is sometimes stylized as ''ePUB''. EPUB is supported by many e-readers, and compatible software is available for most smart ...
.
RELAX NG shares with W3C XML Schema many features that set both apart from traditional DTDs: data typing,
regular expression
A regular expression (shortened as regex or regexp), sometimes referred to as rational expression, is a sequence of characters that specifies a match pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
support,
namespace
In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified.
Namespaces ...
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
A filename extension, file name extension or file extension is a suffix to the name of a computer file (for example, .txt, .mp3, .exe) that indicates a characteristic of the file contents or its intended use. A filename extension is typically d ...
".rng". For schemas in the compact syntax, the extension ".rnc" is used.
Relax NG schemas can be converted to DTDs by applying Trang which can be found at The manual for Trang is located a Note that Trang is unable to convert the
OASIS
In ecology, an oasis (; : oases ) is a fertile area of a desert or semi-desert environmentDarwin Information Typing Architecture, DITA 1.3 schema to DTDs, failing with messages like:
sorry, combining definitions with combine="choice" is not supported
See also
*
XML schema
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself. These constrai ...