OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] NVDL Question: validate one part of a compound document, independent of other parts?

Thanks a lot Jirka! 

I implemented and ran my example (Book + NY Times) compound document
using the NVDL script that Jirka provided.

NVDL is very cool!

If others would like to try NVDL, I provide below everything you need
to get started.

1. Download and unzip the Oxygen XML implementation of NVDL here:


2. Here is a compound document (Book-Plus-NYtimes.xml):

<?xml version="1.0"?>
<Book xmlns="http://www.books.com";>
    <Title>The Wisdom of Crowds</Title>
    <Author>James Surowiecki</Author>
    <nytimes:NewYorkTimes xmlns:nytimes="http://www.nytimes.com";>
        <nytimes:role>Staff writer</nytimes:role>
        <nytimes:column>The Financial Page</nytimes:column>
    <Publisher>Anchor Books</Publisher>

2.1 Here is Book.xsd

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
    <element name="Book">
                <element name="Title" type="string"/>
                <element name="Author" type="string"/>
                <element name="Date" type="gYear"/>
                <element name="ISBN" type="string"/>
                <element name="Publisher" type="string"/>

2.2 Here is NYtimes.xsd

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
    <element name="NewYorkTimes">
                <element name="role" type="string"/>
                <element name="column" type="string"/>

3. Here is the NVDL script (Book-Plus-NYtimes.nvdl):

<?xml version="1.0"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0";>
   <namespace ns="http://www.books.com";>
     <validate schema="Book.xsd"/>
   <namespace ns="http://www.nytimes.com";>
     <validate schema="NYtimes.xsd"/>

4. At a command line, type this:

java -jar path-to-the-oxygen-onvdl-folder/onvdl/bin/onvdl.jar
Book-Plus-NYtimes.nvdl Book-Plus-NYtimes.xml

5. There will be no errors.  Now introduce an error into the Book
portion of the compound document (Book-Plus-NYtimes.xml).  See the
errors for the Book portion.  Next, introduce errors for the NYTimes
portion.  See the errors for the NYTimes portion.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS