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

Reply via email to