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
