tnx,

for people with the same problem these are the propeties I had to add:
LocalConfiguration.getInstance().getProperties().setProperty("org.exolab.castor.parser.validation",
 "true");
LocalConfiguration.getInstance().getProperties().setProperty("org.exolab.castor.parser.namespaces",
 "true");
LocalConfiguration.getInstance().getProperties().setProperty("org.exolab.castor.sax.features",
 "http://apache.org/xml/features/validation/schema";);

or u can put them in the castor.properties file

han
-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED]
Sent: Thu 1/27/2005 9:17 AM
To: [email protected]
Subject: Re: [castor-user] Validation not working
 


The validation flag is for object model validation not XML schema 
validation, works good when you've used Castor generated source.

For your own object model + mapping file, then you'll need to enable the 
parser validation in the castor.properties file if you want the parser 
to validate using your xml schema.

--Keith


Han Weyn wrote:
> Hi,
> 
> I'm trying to validate an XML with a schema in Castor but although the
> XML is not valid(I checked that in an XML editor on the same machine),
> no ValidationException gets thrown.
> 
> 1) is it possible to validate an XML with an XSD schema in Castor(using
> a mapping based unmarshaller)?
> 
> 2) what am I doing wrong?
> 
> XML:
> ====
> <?xml version="1.0"?>
> <klantsystemen xmlns="http://schemaserver/schemas/1.0/";
> xmlns:cs="http://schemaserver/schemas/1.0/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> schemaVersion="1.0" xsi:schemaLocation="http://schemaserver/schemas/1.0/
> http://schemaserver/schemas/1.0/schema.xsd";>
> <control_area> 
> ...
> </control_area>
> </klantsystemen>
> 
> Java:
> =====
> I'm using an unmarshaller with a Mapping and I've set the validation
> flag to true
> 
> 
> Tnx
> 
> Han Weyn
> Software engineer 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



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

<<winmail.dat>>

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

Reply via email to