Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] validation against xml schema (xsd)

From: George Cristian Bina <george@---------.--->
To: "Johnson, Matthew C. (LNG-HBE)" <Matthew.C.Johnson@----------.--->
Date: 3/6/2009 1:30:00 PM
Hi Matt,

Philippe is right, NVDL should work, I also should have suggested it.
You can find the available NVDL implementations linked from here

http://nvdl.org/

In addition to those listed there you can also use Jing from
http://code.google.com/p/jing-trang/
because the oNVDL implementation was merged back into Jing. Note however 
that you need to check out Jing [1] and just run its build script to get 
the jars with NVDL support, for details see [2].

Basically you need to create a script that in the initial mode matches 
on each namespace you are interested in and validates with the schema 
for each namespace using a mode that attaches all the descendant 
sections to the initial one, something like below:

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" 
startMode="match">
     <mode name="match">
         <namespace ns="http://www.example.com/namespaceA">
             <validate schema="a.xsd" useMode="attach"/>
         </namespace>
         <namespace ns="http://www.example.com/namespaceB">
             <validate schema="b.xsd" useMode="attach"/>
         </namespace>
     </mode>
     <mode name="attach">
         <anyNamespace><attach/></anyNamespace>
     </mode>
</rules>

Note also that using NVDL allows you to use not only XML Schema but also 
Schematron and Relax NG and also you can validate a document against 
multiple schemas:

Relax NG:
         <namespace ns="http://www.example.com/namespaceC">
             <validate schema="c.rng" useMode="attach"/>
         </namespace>
Multiple validations, against XSD and Schematron:
         <namespace ns="http://www.example.com/namespaceD">
             <validate schema="d.xsd" useMode="attach"/>
             <validate schema="d.sch" useMode="attach"/>
	</namespace>

[1] http://code.google.com/p/jing-trang/source/checkout
[2] http://code.google.com/p/jing-trang/wiki/HowToBuildFromSource

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com

Johnson, Matthew C. (LNG-HBE) wrote:
> Thank you Philippe.  I had been considering NVDL (I recall a thread
> involving Roger Costello on NVDL) but have not had time to investigate
> further.  Perhaps, this will give me the proper motivation!
> 
> Matt
> 
> 
>> -----Original Message-----
>> From: Philippe Poulard [mailto:philippe.poulard@s...]
>> Sent: Friday, March 06, 2009 4:28 AM
>> To: Johnson, Matthew C. (LNG-HBE)
>> Cc: xml-dev@l...
>> Subject: Re: [xml-dev] validation against xml schema (xsd)
>>
>> Hi,
>>
>> I think NVDL can do this for you:
>> http://nvdl.org/
>>
>> --
>> Cordialement,
>>
>>                ///
>>               (. .)
>>   --------ooO--(_)--Ooo--------
>> |      Philippe Poulard       |
>>   -----------------------------
>>   http://reflex.gforge.inria.fr/
>>         Have the RefleX !
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l...
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent