Java Mailing List Archive

Home » user.castor »

[castor-user] Marshalling Validation - castor 1.3: Not erroring for
undefined element



Replies: Find Java Web Hosting

Author LoginPost Reply


I am using castor 1.3 and I am just using the marshalling validation for the
given xml.
I have the xsd from which I generated classes using casto 1.3. Now when the
system receives the xml, it goes through marshalling validation in which:
-It validates the mandatory missing fields
-It validates the data type of the elements so it adheres to the definition
given xsd for eg: String length, alpha numeric format - etc

However there is one thing that it is failing to validate is:
If there is any node/element which does not match with the ones given in
xsd: it simply ignores the undefined element(s) and processes the rest of
xml without spitting out the error. The way it should be is it should error
out complaining about the undefined element. There is no generated class for
the given node - when doing the marshalling validation.

How can I change the so it would error when it comes
across undefined element during the marshalling process.

I hoped this property in would work:
But changing it to 'false' has no change.


Here are the other significant properties set in my

# True if xml documents should be validated by the SAX Parser
# Defaults to false.

# True for parser to support Namespaces.
# Defaults to false.

# True if all documents should be validated by the marshaling framework
# Defaults to true.


# An implementation which uses the Jakarta RegExp library:
# An implementation which uses the Jakarta ORO library:

Sent from the Castor - User mailing list archive at

To unsubscribe from this list, please visit:

©2008 - Jax Systems, LLC, U.S.A.