FACTOID # 93: Saudi diplomats have 367 unpaid parking fines in Britain.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > RELAX NG

In computing, RELAX NG (REgular LAnguage for XML Next Generation) is a schema language for XML, based on Murata Makoto's RELAX and James Clark's TREX. A RELAX NG schema specifies a pattern for the structure and content of an XML document. A RELAX NG schema is itself an XML document; however, RELAX NG also offers a popular compact, non-XML syntax. Compared to other popular schema languages, RELAX NG is relatively simple. Memory (Random Access Memory) Look up computing in Wiktionary, the free dictionary. ... 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 syntax constraints imposed by XML itself. ... The Extensible Markup Language (XML) is a general-purpose markup language. ... Murata Makoto ) (born 1960) is a Japanese computer scientist. ... There is also an album by Blur called Leisure. ... Clark, (February 23, 1964) is the author of groff and expat and has done much work with open-source software and XML. Born in London, Charterhouse School|Charterhouse]] and Merton College, Oxford, Clark has lived in Bangkok, Thailand since 1995, and is now a permanent resident. ... The word Trex has the following meanings: Trex a composite material. ... The Extensible Markup Language (XML) is a general-purpose markup language. ...


It is defined by a committee specification of the OASIS RELAX NG technical committee, and also by part two of the international standard ISO/IEC 19757: Document Schema Definition Languages (DSDL). The Organization for the Advancement of Structured Information Standards (OASIS) is a global consortium that drives the development, convergence and adoption of e-business and web service standards. ... The International Organization for Standardization (ISO) is an international standard-setting body composed of representatives from various national standards bodies. ... The International Electrotechnical Commission (IEC) is an international standards organization dealing with electrical, electronic and related technologies. ... Document Schema Definition Languages (DSDL) is a framework within which multiple validation tasks of different types can be applied to an XML document in order to achieve more complete validation results than just the application of a single technology. ...

Contents

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:

 <book> <page>This is page one.</page> <page>This is page two.</page> </book> 

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: Matryoshka disassembled A matryoshka doll (Russian: , IPA ) or a Russian nested doll (also called stacking dolls or Babushka dolls) is a set of dolls of decreasing sizes placed one inside another. ...

 <grammar xmlns="http://relaxng.org/ns/structure/1.0"> <start> <element name="book"> <oneOrMore> <element name="page"> <text/> </element> </oneOrMore> </element> </start> </grammar> 

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:

 <grammar xmlns="http://relaxng.org/ns/structure/1.0"> <start> <element name="book"> <oneOrMore> <ref name="page"/> </oneOrMore> </element> </start> <define name="page"> <element name="page"> <text/> </element> </define> </grammar> 

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 DTDs. Here is the compact form of the Russian-doll schema: Simple Outline XML (SOX) is an alternative syntax used to simplify the textual representation of Extensible Markup Language (XML) documents. ... The Extensible Markup Language (XML) is a general-purpose markup language. ... Document Type Definition (DTD), defined slightly differently within the XML and SGML specifications, is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language. ...

 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

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. 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 syntax constraints imposed by XML itself. ... XML Schema, published as a W3C Recommendation in May 2001, is one of several XML schema languages. ... DocBook is a markup language for technical documentation, originally intended for authoring technical documents related to computer hardware and software but which can be used for any other sort of documentation. ... OpenDocument or ODF, short for the OASIS Open Document Format for Office Applications, is a document file format used for describing electronic documents such as memos, reports, books, spreadsheets, charts, presentations and word processing documents. ...


RELAX NG shares with W3C XML Schema many features that set both apart from traditional DTDs: data typing, regular expression support, namespace support, ability to reference complex definitions. Document Type Definition (DTD), defined slightly differently within the XML and SGML specifications, is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language. ... In computer science, a datatype or data type (often simply a type) is a name or label for a set of values and some operations which one can perform on that set of values. ... In computing, a regular expression is a string that is used to describe or match a set of strings, according to certain syntax rules. ... A namespace is a context in which a group of one or more identifiers might exist. ...


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. A filename extension is a suffix to the name of a computer file applied to show its format. ...


See also

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 syntax constraints imposed by XML itself. ... Document Type Definition (DTD), defined slightly differently within the XML and SGML specifications, is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language. ... Document Structure Description, or DSD, is an XML schema language, for describing valid XML documents. ... 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 syntax constraints imposed by XML itself. ... The Schematron is an XML structure validation language for making assertion about the presence or absence of patterns in trees. ...

External links


  Results from FactBites:
 
RELAX NG - Wikipedia, the free encyclopedia (741 words)
In computing, RELAX NG (REgular LAnguage for XML Next Generation) is a schema language for XML, based on Murata Makoto's RELAX and James Clark's TREX.
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.
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.
RELAX NG home page (1162 words)
RELAX NG is a schema language for XML.
Schematron constraints embedded as annotations in the RELAX NG.
It does aims only to produce a RELAX NG schema that is equivalent to the input schema in the sense that it validates the same documents as the input schema; it does not aim to preserve information that is not significant for validation such as the use of definitions.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.