xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schuhegger <Christian.Schuheg...@gmx.de>
Subject Re: JARV and DocumentFragment validation
Date Tue, 21 Oct 2003 15:33:24 GMT

> I think one can use MSV 
> http://wwws.sun.com/software/xml/developers/multischema/ or 
> https://msv.dev.java.net/ for partial validation. It doesn't give this 
> functionality OOTB though, but its internal API at least, IIUC, contain 
> the components you need for building e.g. a DOM-tree with partial 
> validation functionality for sub trees. Take a look at the native 
> validation interface 
> https://msv.dev.java.net/unbranded-source/browse/*checkout*/msv/msv/doc/acceptor.html?rev=1.1

Thanks for your hint. Actually I do all my tests with MSV, but at least 
with the JARV interface partial validation does not work OOTB as you 
mentioned already. I also got a reply from Kohsuke Kawaguchi who 
proposed an implementation path:

> W3C have defined an API for partial validation: DOM Level 3 Validation 
> Specification http://www.w3.org/TR/DOM-Level-3-Val/ it is designed for 
> schema based editing, so besides partial validation you can also ask 
> what kind of element that is allowed to insert at a certain place in the 
> DOM-tree. Quite cool IMO, but I don't know if there are any 
> implementations yet.

Yes, this sounds interesting.

Perhaps while I am just asking perhaps it would also be a good idea to 
explain a bit about the background of my question. There are several 
form validation packages out there, basically one for every web 
application framework. But in fact the form validation task is in large 
parts exactly the same functionality as implemented in xml validation 
libraries, except that xml validation libraries do not support cross 
checks between the values of different fields and they do not allow to 
configure a custom failure message in case that a field could not be 
validated. In order to find out which element in the form caused the 
validation error I would like to validate each sub-element one at a 
time. I have seen that the interface org.w3c.dom.DOMError has a method:
	public DOMLocator getLocation();
But at least the current Xerces-j implementation does not implement the:
	public Node getRelatedNode();
method of the DOMLocator object.

Another problem I will have to solve is how to receive real Java objects 
from the validated XML file. I mean after I know that the data is in the 
correct string format I thought there should be an easy way to query 
e.g. the PSVI interfaces for the real Java value like Integer, Date, 
Double, ... but I had to find out that the Xerces-j team is currently 
planning to implement an extension of the current PSVI interfaces to 
allow something in that direction. It is not available right now. If 
anybody has a suggestion for that problem in the meantime I would be 
happy to hear about that.

Thanks again for your information!!
Christian Schuhegger

To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message