oNVDL - Oxygen XML NVDL Implementation Based on Jing

The oNVDL project has reached the end of its life-cycle. The implemented NVDL support was contributed to the Jing-Trang project that can be downloaded from: https://github.com/relaxng/jing-trang

NVDL (Namespace Validation Dispatching Language) is Part 4 of ISO/IEC 19757 DSDL (Document Schema Definition Languages). It allows you to specify sections of XML documents to be validated against different schemas, thus enabling the creation of complex documents containing multiple languages without the need to modify the schemas that define each language to take into account other languages. It also allows you to mix different schema types (such as XML Schema, Relax NG and Schematron). A typical example is a document that contains XForms content inside XHTML.

NVDL is the successor of NRL (Namespace Routing Language), which was created by James Clark in 2003. Jing, also created in 2003 by James Clark, is known as the reference implementation for Relax NG, but it also contains support for NRL, Schematron and XML Schema validation (the XML Schema validation is based on Xerces).

About oNVDL

Starting with version 20070517, oNVDL provides two NVDL implementations, one in Java and one in XSLT 2.0, the latter being only for the dispatching part of NVDL.

oNVDL was developed on top of Jing to add NVDL support starting from the existing NRL support. This version of oNVDL is based on Jing version 20030619 and changes Jing as follows:

  • Adds NVDL support
  • Updates the support for Xerces to work with Xerces 2.9.0
  • Updates Saxon to Saxon 6.5.5
  • Removes the Xerces J 1 Regular Expression Engine implementation (com/thaiopensource/datatype/xsd/regex/xerces/RegexEngineImpl.java)
  • Uses the EntityResolver if specified in the AutoSchemaReader class
  • Handles InputSource objects with character stream in AutoSchemaReader

oNVDL is an almost complete (see known limitations below) implementation of NVDL. Having oNVDL implemented on top of Jing has a number of benefits, such as working in streaming mode (thus avoiding having all of the document loaded in memory) and built-in validation support for Relax NG, XML Schema, and Schematron.

oNVDL is a freely available open-source project. See the license for copying permissions.

oNVDL was developed to add NVDL support in Oxygen XML Editor.

Changes in Version 20070517

  • Initialize the Log4j system from the code in case there is no log4j.configuration file in classpath
  • Dump the ns attribute on nsName in PatternDumper
  • Handle InputSource objects with character stream in AutoSchemaReader
  • XSLT implementation of NVDL dispatching except point 8.6. Stage 4: Filtering of the combined sections (from the specification), support for cancelNestedActions and support for included modes
  • Avoid a StackOverflowError if validate/@schema is empty
  • Fix handling of attribute sections
  • Perform schema rewriting to validate attribute sections for XML Schema
  • Started work on adding ISO Schematron support

Known Limitations

oNVDL does not implement support for inline schemas in the current version 20070517.

The XSLT 2.0 implementation of NVDL dispatching does not implement the following in the current version 20070517:

  • Point 8.6. Stage 4: Filtering of the combined sections (from the specification)
  • Support for cancelNestedActions
  • Support for included modes

References

oNVDL source code - https://github.com/relaxng/jing-trang

NVDL specification - http://nvdl.org/

Jing - http://www.thaiopensource.com/relaxng/jing.html

NRL description - http://www.thaiopensource.com/relaxng/nrl.html