When using the validation of Castor, you can validate the data and the structure
without
caching a grammar (method used by parsers validation) and so it much better.
However I don't have official benchmarks and the validation process is still in
development so
if you found nasty bugs, please submit them to the list so that we can fix them.

Thanks,
Arnaud

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, August 18, 2001 1:48 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] Validation Differences?
>
>
>
> Thanks for the response Dave. I am curious as to why Castor would write its
> own validation mechanism? If they are relying on the underlying parsers
> anyway then why go through the trouble of writing your own validation code?
> I have also seen where I have just used parser.validation = true and
> castor.validation=false and the document passes validation.When I run it
> through my own code using SAXParser it fails. Its like Castor is eating and
> SAXExceptions that get thrown. When I turn on castor.validation it catches
> the problem in the document. Also Arnaud mentions the overhead associated
> with using the underlying parser validation. Have they somehow optimized
> validation in Castor that makes it perform that much better? Any benchmarks
> available?
>
> Thanks
>
> Keith Nielsen
> digitalESP
>
>
>
>
>
>                     dave young
>
>                     <dyoung@bsis.        To:
> [EMAIL PROTECTED]
>                     com.au>              cc:     (bcc: Keith
> Nielsen/digitalesp)
>                                          Subject:     Re:
> [castor-dev] Validation Differences?
>                     08/18/2001
>
>                     12:03 AM
>
>                     Please
>
>                     respond to
>
>                     castor-dev
>
>
>
>
>
>
>
> Keith,
>
> I am pretty fresh to this myself, but my understanding (gleaned from
> Arnaud) is;
>
> marshalling validation turns on grammer and lexical checking of the xml
> during marshalling and unmarshalling. this checking is performed with
> the help of the castor class descriptors.
>
> parser validation causes a sax parser (xerces??) to be run over the xml.
> i don't know exactly when it is run.
>
> my understanding is, that if you want to perform your validation upon
> marshalling and unmarshalling of your xml data, that you should only
> need to turn on marshalling validation. that said, i have some unit
> tests upon which castor marshalling validation does not pick up some
> errors in xml data. some situations where i have errors that go
> undetected are;
> (*) boolean attribute value that is not "true", "false", 1 or 0.
> (*) choice of mandatory elements where no elements are present.
> (*) element with a value for a prohibited attribute
> mind you, i think the intalio guys have done an amazing amount of work
> for which i am grateful and i am sure that these issues will get
> addressed in due time.
>
> hope this helps a little :-)
>
>
> Regards,
>
> Dave Young.
>
> this is the previous posting from arnaud;
>
> > Hi Dave,
> >
> > If you put parser.validation=true, it means that you let the parser do
> some
> > validation and this option
> > might be used if you don't generate classes to represent your schema for
> > instance.
> >
> > But if you generate classes to represent your schema and you want to
> validate
> > some XML instances
> > when unmarshalling (or some objects while marshalling), you only need the
> > marshalling.validation=true and
> > not the parser validation.
> > Castor offers an alternative to the validation made by any parser that
> > introduces overhead as you
> > pointed out.
> >
> > To sum up:
> >          - if you are using XML Schema and want Castor to validate your
> XML towards this
> > Schema, generate
> > the relevant classes that describe your XML Schema (and the descriptors)
> and set
> > the marshalling.validation
> > to true and that's all!.
> >          - if you want the parser to do its validation job (with the
> amount of overhead
> > it imply)
> > set the parser.validation to true. It is useful when you don't want to
> generate
> > descriptors
> > and just use a mapping file.
> >
> > I hope I help you (if not just give me another chance ;+))
> >
> > Arnaud
> >
> >
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>            unsubscribe castor-dev
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to