Skip to main content


developerWorks  >  XML  >

RELAX NG

Express the grammatical rules for an XML vocabulary

developerWorks

Level: Intermediate

Contributors: OASIS, ISO

06 Feb 2007
Updated 25 Apr 2007

RELAX NG is a grammar-based XML schema language used to describe, define, and limit XML vocabularies. Find out why some people dislike Document Type Definition (DTD), and discover how RELAX NG aims to improve upon it.

RELAX NG [OASIS Committee Specification and ISO Standard ISO/IEC 19757- 2:2003] is an XML schema language, meaning it is a language that you can use to define and limit XML vocabularies. The original XML schema language is the DTD, defined in XML 1.0 itself. However, some people dislike DTD for its awkward syntax, limitations in the text and markup constructs it can express, and the difficulty of handling XML Namespaces. Several new XML schema languages have emerged to supplant or augment DTDs, including RELAX NG, which is renowned for its simplicity and expressiveness. The core specification of RELAX NG defines an XML syntax for schemata, but there is also a RELAX NG Compact Syntax [OASIS Committee Specification and ISO Standard ISO/IEC 19757-2:2003/Amd.1:2006], which defines a simple text syntax for RELAX NG schemata. The ISO versions of RELAX NG are now available for free from ISO's Freely Available Standards page.


Resources

  • Read Nicholas Chase's introductory tutorial Understanding RELAX NG, which gets you up to speed on both RELAX NG's simplicity and its power, including both its full XML-based and its compact syntax (developerWorks, December 2003).

  • David Mertz's XML Matters column on developerWorks focuses on RELAX NG in his series "Kicking back with RELAX NG":
    • Part 1 looks at the general semantics of RELAX NG and touches on datatyping (February 2003).
    • Part 2 continues the discussion by addressing a few additional semantic issues and looking at tools for working with RELAX NG (March 2003).
    • Part 3 explores the RELAX NG compact syntax in detail and explains the exact correspondences between compact syntax and XML syntax (May 2003).

  • Take a look at the official tutorials for RELAX NG's core and its compact syntax.

  • ZVON offers a combined tutorial for RELAX NG and W3C XML Schema language.

  • Many resources are linked from the RELAX NG home page.

  • ZVON offers a RELAX NG Reference.

  • One of the aspects of RELAX NG that might trip you up is expressing simple text patterns, so Uche Ogbuji provides some guidance in Tip: Use the right pattern for simple text in RELAX NG (developerWorks, October 2005).

  • RELAX NG allows you to define your own data types, as demonstrated by Elliotte Rusty Harold in RELAX NG with custom datatype libraries (developerWorks, November 2004).

  • Read about other XML standards: Index of XML standards.

  • Participate in any of several XML-centered forums: XML zone discussion forums.

  • Get involved in the developerWorks community: developerWorks blogs

  • Find out how you can become an IBM-Certified Developer in XML and related technologies at IBM XML certification.

  • See the developerWorks XML Zone for a wide range of technical articles and tips, tutorials, standards, and IBM Redbooks at XML technical library.

  • Stay current with technology in these sessions: developerWorks technical events and webcasts.

  • Build your next development project with trial software available for download directly from developerWorks: IBM trial software

Back to top


Document options

Document options requiring JavaScript are not displayed