JAXB Validation without a Schema

Part of the benefit of JAXB is that a schema is not required; annotating Java classes alone allows for XML serialization/deserialization. With the deprecation of the Unmarshaller.setValidating() in favor of the unmarshaller.setSchema() method, however, it seems that validation is only available when an XSD is present. Is there another way to validate XML during unmarshalling without a physical schema file?

[416 byte] By [shelleyLa] at [2007-11-27 11:58:13]
# 1

u can do validation without a schema.. try this....

unmarshaller.setValidating(true);

it will throw any exception u may have during the unmarshalling...

hope this help..

JWKC-5ivea at 2007-7-29 19:18:23 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...