[dsdl-comment] The XML validation equation = instance document + schemas + associations

From: Costello, Roger L. <costello@mitre.org>
Date: Tue Mar 10 2009 - 20:05:28 UTC

Hi Folks,
 
A compelling argument for NVDL is the modularity it brings to the validation process. Below is a description of what I mean by this. [The description is intended for those managers who need convincing of NVDL's benefits]

THE VALIDATION PROCESS

There are 3 parts to validating:
 
1. The XML instance document to be validated.
 
2. The schema or schemas to be used to validate the instance document against.
 
3. The information that connects the instance to the schemas.
 
For modularity, each part should be kept separate.
 
It's likely that you are very comfortable with parts 1 and 2. You know how to write instance documents, and you know how to write XML Schemas, RELAX NG, Schematron schemas, and so forth.
 
But what about part 3, how are you expressing that association information? Are you writing proprietary procedural code? Are you embedding the risky schemaLocation attribute in your instances, e.g.
 
    <BookStore xmlns="http://www.books.org"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.books.org
                                   BookStore.xsd">
           ...
    </BookStore>

There is a standard, declarative way of expressing the association information: NVDL.

By using NVDL you modularize the validation process into 3 parts.

Here is how to declaratively express the association between the BookStore instance and the BookStore schema:

    <rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0">
        <namespace ns="http://www.books.org">
            <validate schema="BookStore.xsd" />
        </namespace>
    </rules>

There are other benefits to using NVDL, but the modularity it provides should be enough to convince you to use it.

/Roger

--
DSDL comments
To unsubscribe, please send a message with the
command  "unsubscribe" to dsdl-comment-request@dsdl.org
(mailto:dsdl-comment-request@dsdl.org?Subject=unsubscribe)
Received on Tue Mar 10 21:05:32 2009

This archive was generated by hypermail 2.1.8 : Tue Mar 10 2009 - 20:13:02 UTC