• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
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: 1462
  • 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: 13058
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic