Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JIBX validate the structure of input xml file before unmarsalling it?  RSS feed

 
dong zhang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. The validation is mainly validate the structure of input xml file. I need to qulify whether the xml has a correct format for parsering.

2. Besides, I need to print the error message for the error elements in xml file.

I serach some method that use XSD to validate xml file. But, I don't know how to implement it.

Thanks.




 
kri shan
Ranch Hand
Posts: 1487
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JIBX does not support Schema validation. If you want strict Schema validation, then use JAXB / XML Beans data binding frameworks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no reason you could not read the file twice, once for validation and then again with JIBX.

Check out the javax.xml.validation package.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!