Namespace-based Validation Dispatching Language

from Wikipedia, the free encyclopedia

The Namespace-based Validation Dispatching Language (NVDL) is an XML schema language for validating XML documents, the structure of which has been defined with different schema languages ​​and in different namespaces . NVDL is an ISO / IEC standard and part 4 of the DSDL specification. Much of NVDL is based on the Namespace Routing Language (NRL) developed by James Clark . In its simplest form, an NVDL document consists of a mapping of XML namespace URIs to schema URIs.

Validation

XML applications can contain elements or attributes of other XML applications. The namespace of the external XML application is often imported for this purpose. An example of this is SVG within XHTML . The imported elements are not necessarily defined in the same schema language as the importing XML application, which means that validation with only one schema language is not sufficient.

Based on namespaces, NVDL creates a connection between the different schemas and schema languages ​​by assigning a schema to individual namespaces. A validation software can use it to check a specific XML document against different schemes.

format

NVDL documents contain a list of rules that trigger various actions. Rules refer to a namespace and a mode. A mode is a specific state during the validation of the document. Different modes allow, for example, a strict and a lax validation.

Actions are taken when a rule applies. Actions can validate document parts, declare the XML document to be invalid, declare part of the document as valid, return the processing to the parent node or change the current processing mode. Various actions are allowed within a rule, for example to check a single element against schemas in different schema languages.

example

<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0">
  <namespace ns="http://www.w3.org/1999/xhtml">
    <validate schema="xhtml.rng"/>
  </namespace>
  <namespace ns="http://www.w3.org/2000/svg/">
    <validate schema="svg.sch"/>
  </namespace>
  <anyNamespace>
    <reject/>
  </anyNamespace>
</rules>

This NVDL schema validates those parts that use the XHTML 1.0 namespace with a RELAX-NG schema, and the parts in the SVG 1.0 namespace against a Schematron schema . Parts from all other namespaces are rejected.

Web links