Greetings,

I'm trying to validate a xml with castor in the unmarshalling process.

For instance for this structure:
<root>
  <a>
    <b/>
  </a>
</root>

The code for unmarshalling is:

Unmarshaller unmarshaller=new Unmarshaller(Root.class);
unmarshaller.setValidation(true);
Root root =(Root)unmarshaller.unmarshal(reader);


The strange thing is the validation is working for:
- XML is well formed
- validation only for the child elements of root (not the root it self)

If I passed this element:

<newroot>
  <a>
    <b/>
  </a>
</newroot>

The castor validates my XML well!! 

I don't think this is the normal behaviour of castor or is it?
Is there any workaround?

Thanks.

BTW,I'm using castor 0.5.9.3. 

Regards,
Pedro Salazar
-- 
Pedro Salazar
pedro-b-salazar \at ptinovacao \dot pt
PGP 0xD803BC61 http://pgp.mit.edu/



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

Reply via email to