This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

XmlBeans Validation

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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!

Cheers,
Rabindra
 
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic