wood burning stoves*
The moose likes XML and Related Technologies and the fly likes XmlBeans Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XmlBeans Validation" Watch "XmlBeans Validation" New topic

XmlBeans Validation

RabindraBlr Sahoo

Joined: Nov 04, 2008
Posts: 7

I am validating xml by validate() function provided by XmlBeans. But in my xml there are some tags which are not mentioned in xsd(Schema).
I am able to parse properly with the unwanted tag using XmlObject.Parse(), but the validation fails.

Is there any way to validate only the required tag present in XSD and skipping the unwanted tag.

Thanks in Advance!

Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

No. The purpose of validating a document against a schema is to ensure that the document has the structure that the schema says it should. Either it does or it doesn't.

So what is the underlying problem here? Are people sending you documents which don't match the schema? If so, send them back and get them to fix the documents. Perhaps some training is needed for those people? Or perhaps they need a better tool to prevent them from making these errors?
It is sorta covered in the JavaRanch Style Guide.
subject: XmlBeans Validation
Similar Threads
XmlBeans validation
XSD validation
help in testing xml
XML Validation in Castor
validating xml with xsd