James Clark has announced the publication of a Namespace Routing Language (NRL) specification. NRL is "an XML language for combining schemas for multiple namespaces; it allow the schemas that it combines to use arbitrary schema languages." The release includes a tutorial and specification document and a sample implementation in the Jing (RELAX NG Validator in Java) distribution. NRL "is the successor to Clark's Modular Namespaces (MNS) language and is intended to be another step on the path towards Document Schema Definition Languages (DSDL) Part 4."
The W3C XML Namespaces Recommendation itself "allows an XML document to be composed of elements and attributes from multiple independent namespaces: each of these namespaces may have its own schema and the schemas for different namespaces may be in different schema languages. The problem then arises of how the schemas can be composed in order to allow validation of the complete document." The Namespace Routing Language attempts to solve this problem. Among the features and benefits of NRL: it supports schema language coexistence, allows extension of schemas not designed to be extended, makes authoring of extensible schemas easier supports 'transparent' namespaces, allows contextual control of extension, and allows concurrent validation. "For RELAX NG, it can be used to provide some of the namespace-based modularity features that are built-in to XSD."
"NRL is designed to allow an implementation to stream, and the sample implementation does so. The sample implementation [Jing RELAX NG validator in Java] has a SAX-based plug-in architecture that allows new schema languages to be added dynamically. It comes with support for RELAX NG (both XML and compact syntax), W3C XML Schema (via a wrapper around Xerces-J), Schematron, and (recursively) NRL. W3C XML Schema and Schematron schemas are autodetected (using the namespace URI) and can be used as both top-level schemas and as NRL subschemas. With the new Jing release, NRL can also use any schema language with an implementation that supports the JARV interface." [adapted from the announcement and NRL website]
Bibliographic Information
Namespace Routing Language (NRL). By James Clark. Date: 2003-06-13. Copyright (c) Thai Open Source Software Center Ltd. Abstract: "The XML Namespaces Recommendation allows an XML document to be composed of elements and attributes from multiple independent namespaces. Each of these namespaces may have its own schema; the schemas for different namespaces may be in different schema languages. The problem then arises of how the schemas can be composed in order to allow validation of the complete document. This document proposes the Namespace Routing Language (NRL) as a solution to this problem. NRL is an evolution of the author's earlier Modular Namespaces (MNS) language."
Namespace Routing Language Features and Benefits
NRL provides the following features and benefits [per the text of the announcement]:
Supports schema language coexistence. For example, if you have a schema for XHTML in RELAX NG and a schema for SVG in W3C XML Schema, NRL allows you to validate an XHTML document that embeds SVG, without having to convert either of your schemas.
Allows extension of schemas not designed to be extended. For example, suppose you have an schema for XHTML which does not allow extension, but you want to embed SVG in XHTML. NRL allows you to do so without having to add wildcards to your XHTML schema.
Makes authoring of extensible schemas easier. Instead of having to clutter up a schema with wildcards, you can write a simple schema without wildcards and then use NRL to specify what kind of extension is allowed.
Supports "transparent" namespaces. By transparent namespace, I mean a namespace t where you want to validate <x><t:y><z/></t:y></x> like <x><z></x>. This is useful for namespaces that provide templates or versioning.
Allows contextual control of extension. If you have a W3C XML Schema that uses wildcards in different contexts, you can use NRL to control which namespaces are allowed in each context.
Allows concurrent validation. You can specify that a particular namespace or the whole document is validated with respect to multiple schemas, which may be in different schema languages. So you could validate a document against both a W3C XML Schema schema and a Schematron schema.
For RELAX NG, it can be used to provide some of the namespace-based modularity features that are built-in to XSD.
Principal references:
- Announcement 2003-06-19: "Namespace Routing Language."
- Namespace Routing Language (NRL). Tutorial and specification.
- Jing: A RELAX NG Validator in Java. The Jing Version 20030619 distribution includes a sample implementation of NRL.
- Jing Support for Other Schema Languages: Schematron, W3C XML Schema, Namespace Routing Language (NRL), Modular Namespaces (MNS).
- Modular Namespaces (MNS) language. NRL represents an evolution of James Clark's earlier MNS language.
- ISO Working Group Publishes Committee Draft for DSDL Standard, Part 4.
- ISO/IEC JTC 1/SC34/WG1 documents covering DSDL Part 4, in FCD as of May 2003:
- "Comment disposition of JTC 1/SC 34 N 363 CD Ballot for 19757-4 - DSDL Part 4 - Selection of Validation , London, 3-4 May 2003." ISO/IEC JTC 1/SC34 N415. 7 May 2003. "Based on the comment disposition, Project Editors are requested to create a text for the FCD."
- "Summary of Voting on JTC 1/SC 34 N 363 CD Ballot for 19757-4 - DSDL Part 4 - Selection of Validation Candidates." Project: 19757-4 - DSDL Part 4 . ISO/IEC JTC 1/SC34 N0389. 26 March 2003. "Based on the ballot responses, this CD is approved to advance to FCD ballot. Project Editors are requested to review comments and take them into consideration when preparing revised text..."
- "Committee Draft for DSDL part 4: Selection of Validation Candidates ." ISO/IEC JTC 1/SC34 N363 (Draft). 2002-12-11.
- Rick Jelliffe on Namespace Routing Language and DSDL (Defaults, PSVI)
- Thai Open Source Software Center RELAX NG website
- OASIS RELAX NG Technical Committee website
- Contact: James Clark (Thai Open Source Software Center Ltd, Bangkok, Thailand).
- DSDL.org web site
- "Document Schema Definition Languages (DSDL)" - Main reference page.
- "Namespaces in XML" - Main reference page.
- "RELAX NG" - Main reference page.
- "Schematron: XML Structure Validation Language Using Patterns in Trees" - Main reference page.
- "XML Schemas" - Main reference page.