users@jaxb.java.net

Unmarshal time validation not working?

From: Andrew Ferguson <Andrew.Ferguson_at_arm.com>
Date: Tue, 3 Aug 2004 18:27:34 +0100

hi,
 
 I've been using an Unmarshaller which has had setValidating(true)
called - but recently noticed it is not actually validating the xml.
(Running a simple java DOM validation or an external xml tool shows up
errors in the same file). The only reason I can think that this would
happen is if the DTD reference is not being followed, and the validation
is instead with respect to the schema that generated the classes in the
first place.
 
This page:
http://java.sun.com/xml/jaxb/users-guide/jaxb-works.html#arch_validation
says that "When the unmarshalling process incorporates validation and it
successfully completes without any validation errors, both the input
document and the resulting content tree are guaranteed to be valid" but
not what they are guaranteed to be valid against.
 
By following the example code for setting up an XMLReader and
unmarshalling a SaxSource, validation seems to working again (and
showing up many xml errors) - I'm pretty sure this did work with default
JAXB RI parsing a while ago so is there anything in my environment that
could have changed this? (I have moved from jwsdp 1.3 to 1.4 and made no
code changes as far as i can remember - where any needed?)
 
thanks,
Andrew