You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2005/09/07 21:49:49 UTC

validation block: RELAX-NG, XML-Schema, any other languages required?

I'm almost done implementing XSD (XML Schema) validation using  
Xerces' internals! :-P
That was hard, but I got it working outside Cocoon's sandbox, now it  
only needs a couple of wrappers for source/entity resolution between  
Cocoon and Xerces.

Any other languages that _seriously_ deserve some attention before  
marking the block as "stable" ?

I'm thinking about DTDs using the same Xerces internals, WDYT?

     Pier


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 8 Sep 2005, at 13:01, Pier Fumagalli wrote:
> On 8 Sep 2005, at 11:59, Gianugo Rabellino wrote:
>>
>> ... javax.xml.validation *is* MSV ;-)
>
> Whops... I thought you meant the MSV available from Sun here:
>
> http://www.sun.com/software/xml/developers/multischema/
>
> This is in package "com.sun.msv", and most definitely not  
> redistributable. :-)

Well, no, it actually is. The license seems to be a standard BSD/ 
Apache now:

=============================================================
Copyright (c) 2001-2003 Sun Microsystems, Inc.  All Rights
Reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the
following conditions are met:

- Redistributions of source code must retain the above
   copyright notice, this list of conditions and the
   following disclaimer.

- Redistribution in binary form must reproduct the above
   copyright notice, this list of conditions and the
   following disclaimer in the documentation and/or other
   materials provided with the distribution.

Neither the name of Sun Microsystems, Inc.  or the names of
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.

This software is provided "AS IS," without a warranty of any
kind.  ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS
AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
NON-INFRINGEMENT, ARE HEREBY EXCLUDED.  SUN AND ITS
LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR LIABILITIES
SUFFERED BY LICENSEE AS A RESULT OF OR RELATING TO USE,
MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
DERIVATIVES.  IN NO EVENT WILL SUN OR ITS LICENSORS BE
LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

You acknowledge that Software is not designed,licensed or
intended for use in the design, construction, operation or
maintenance of any nuclear facility.
=============================================================

I'm puzzled

     Pier


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 8 Sep 2005, at 11:59, Gianugo Rabellino wrote:
> On 9/8/05, Pier Fumagalli <pi...@betaversion.org> wrote:
>> On 8 Sep 2005, at 10:19, Gianugo Rabellino wrote:
>>> On 9/7/05, Pier Fumagalli <pi...@betaversion.org> wrote:
>
>
>> If you want to use MSV, simply write a couple of "mocks" classes for
>> what you need, and from there you can build a MSVSchemaParser and a
>> MSVSchema you can use directly with the components provided within
>> the "validation" block. That should be straightforward to do. Someone
>> could do exactly the same for javax.xml.validation in JAXP 1.4 and so
>> on and so forth (actually, javax.xml.validation _is_ redistributed
>> with cocoon, I'll do something with it)...
>>
>
> ... javax.xml.validation *is* MSV ;-)

Whops... I thought you meant the MSV available from Sun here:

http://www.sun.com/software/xml/developers/multischema/

This is in package "com.sun.msv", and most definitely not  
redistributable. :-)

The "javax.xml.validation" package is already in our SVN, so I don't  
see any re-distribution issues tied to that one... :-D

     Pier


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Gianugo Rabellino <gi...@gmail.com>.
On 9/8/05, Pier Fumagalli <pi...@betaversion.org> wrote:
> On 8 Sep 2005, at 10:19, Gianugo Rabellino wrote:
> > On 9/7/05, Pier Fumagalli <pi...@betaversion.org> wrote:

> If you want to use MSV, simply write a couple of "mocks" classes for
> what you need, and from there you can build a MSVSchemaParser and a
> MSVSchema you can use directly with the components provided within
> the "validation" block. That should be straightforward to do. Someone
> could do exactly the same for javax.xml.validation in JAXP 1.4 and so
> on and so forth (actually, javax.xml.validation _is_ redistributed
> with cocoon, I'll do something with it)...

... javax.xml.validation *is* MSV ;-)

Ciao,
-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance: http://www.orixo.com
(blogging at http://www.rabellino.it/blog/)

Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 8 Sep 2005, at 10:19, Gianugo Rabellino wrote:
> On 9/7/05, Pier Fumagalli <pi...@betaversion.org> wrote:
>
>> I'm almost done implementing XSD (XML Schema) validation using
>> Xerces' internals! :-P
>> That was hard, but I got it working outside Cocoon's sandbox, now it
>> only needs a couple of wrappers for source/entity resolution between
>> Cocoon and Xerces.
>>
>> Any other languages that _seriously_ deserve some attention before
>> marking the block as "stable" ?
>>
>
> I'd love to see Schematron, as the only language which allows easy and
> selective validation (not to mention domain-specific validation as
> well). I still don't quite see why you didn't go the MSV way apart
> from distribution issues (we have schema, rng and schematron
> implemented as msv plugins in our validation stuff), but hey, as long
> as you're giving free code away, I'm happy ;)

Well, distribution issues _are_ quite important :-D

If you want to use MSV, simply write a couple of "mocks" classes for  
what you need, and from there you can build a MSVSchemaParser and a  
MSVSchema you can use directly with the components provided within  
the "validation" block. That should be straightforward to do. Someone  
could do exactly the same for javax.xml.validation in JAXP 1.4 and so  
on and so forth (actually, javax.xml.validation _is_ redistributed  
with cocoon, I'll do something with it)...

I don't think that having a dependancy on something we cannot  
redistribute for a generic (and IMVHO essential) feature such as  
validation is a good thing.

But hey, if you want to implement it, mock, and write! :-P

     Pier


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Gianugo Rabellino <gi...@gmail.com>.
On 9/7/05, Pier Fumagalli <pi...@betaversion.org> wrote:
> I'm almost done implementing XSD (XML Schema) validation using
> Xerces' internals! :-P
> That was hard, but I got it working outside Cocoon's sandbox, now it
> only needs a couple of wrappers for source/entity resolution between
> Cocoon and Xerces.
> 
> Any other languages that _seriously_ deserve some attention before
> marking the block as "stable" ?

I'd love to see Schematron, as the only language which allows easy and
selective validation (not to mention domain-specific validation as
well). I still don't quite see why you didn't go the MSV way apart
from distribution issues (we have schema, rng and schematron
implemented as msv plugins in our validation stuff), but hey, as long
as you're giving free code away, I'm happy ;)

Ciao,
-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance: http://www.orixo.com
(blogging at http://www.rabellino.it/blog/)

Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 7 Sep 2005, at 21:26, Daniel Fagerstrom wrote:
> Pier Fumagalli wrote:
>
>> I'm almost done implementing XSD (XML Schema) validation using   
>> Xerces' internals! :-P
>> That was hard, but I got it working outside Cocoon's sandbox, now  
>> it  only needs a couple of wrappers for source/entity resolution  
>> between  Cocoon and Xerces.
>> Any other languages that _seriously_ deserve some attention  
>> before  marking the block as "stable" ?
>> I'm thinking about DTDs using the same Xerces internals, WDYT?
>
> DTDs would be usefull, then you cover everything important, IMO.

Kewl, working on it! :-D

     Pier


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Pier Fumagalli wrote:
> I'm almost done implementing XSD (XML Schema) validation using  Xerces' 
> internals! :-P
> That was hard, but I got it working outside Cocoon's sandbox, now it  
> only needs a couple of wrappers for source/entity resolution between  
> Cocoon and Xerces.
> 
> Any other languages that _seriously_ deserve some attention before  
> marking the block as "stable" ?
> 
> I'm thinking about DTDs using the same Xerces internals, WDYT?

DTDs would be usefull, then you cover everything important, IMO.

/Daniel

Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 8 sept. 05, à 10:23, Pier Fumagalli a écrit :
> ...In terms of modifying the document, well, no, it doesn't do that. 
> But you can implement this (if you need to) extending the 
> ValidationTransformer and making it output annotations derived from a 
> custom ErrorHandler you write...

Cool, thanks for the info! I'll do that in my Copious Free Time or when 
the actual need arises, but it's good to know that it's doable.

-Bertrand

Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 8 Sep 2005, at 07:14, Bertrand Delacretaz wrote:

> Le 7 sept. 05, à 21:49, Pier Fumagalli a écrit :
>
>> ...Any other languages that _seriously_ deserve some attention  
>> before marking the block as "stable" ?
>>
>> I'm thinking about DTDs using the same Xerces internals, WDYT?
>>
>
> Yes, DTDs are still in widespread use, to it would be cool to have  
> a validating transformer for that.
>
> Just curious, do your validators "just" stop processing when they  
> find an error, or can they let the XML flow go through with  
> validation errors added as annotations (inline namespaced XML  
> elements for example)?
>
> My use-case is for example a content management system, where it  
> would be cool to be able to accept a document for storage, while  
> noting that it is not valid.

By default the validator fails. But that is dependant on a  
ErrorHandler. If (for example) the ErrorHandler given in the  
construction of the validating ContentHandler swallows exceptions (or  
logs them, or something else, as longs as it doesn't throw them),  
then it won't fail.

In terms of modifying the document, well, no, it doesn't do that. But  
you can implement this (if you need to) extending the  
ValidationTransformer and making it output annotations derived from a  
custom ErrorHandler you write...

     PIer


Re: validation block: RELAX-NG, XML-Schema, any other languages required?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 7 sept. 05, à 21:49, Pier Fumagalli a écrit :

> ...Any other languages that _seriously_ deserve some attention before 
> marking the block as "stable" ?
>
> I'm thinking about DTDs using the same Xerces internals, WDYT?

Yes, DTDs are still in widespread use, to it would be cool to have a 
validating transformer for that.

Just curious, do your validators "just" stop processing when they find 
an error, or can they let the XML flow go through with validation 
errors added as annotations (inline namespaced XML elements for 
example)?

My use-case is for example a content management system, where it would 
be cool to be able to accept a document for storage, while noting that 
it is not valid.

-Bertrand