Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is there a better alternative to XSD for POJO validation?

richardgundersen-JavaNetNov 25 2008 — edited Nov 26 2008
Hi

I've been given an existing app to fix. It needs to read CSV files in (from various sources, all with different formats) and write the data out to another CSV file (this time in a stardard format)

Half way through this, there's an additional step for validation. It converts the input CSV data to XML, and runs it against an XSD. This provides a bit of validation, but I don't think it's anywhere nearly as powerful as iScreen or Commons Validator (although I don't know XSD very well). Finally the (slightly-validated) XML is converted back to (output) CSV data.

I think this step of converting the data to XML is a bit overkill for the quality of small amount of validation that it provides (and validation rules are likely to get more complex as time goes on). I'm very tempted to take out the XML-related code and just convert to the CSV data to POJOs and then use iScreen/Commons Validator to validate them.

What do people think? Is this a good idea?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2008
Added on Nov 25 2008
2 comments
518 views