A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
XML and Related Technologies
XML and java beans
Joined: Feb 13, 2009
Feb 13, 2009 11:45:17
I am using the JOX library to convert my XML file to
I need to validate this XML file before this object conversion takes place. Doing this with javax.xml.validation
Catch here is-
if there is a erroneous tag it needs to be overlooked as incomplete and not be converted to an object BUT BE SKIPPED. Other valid tags must be converted to objects
e.g. XML where id, name tags are both compulsory
So, object with id = 3 must not be created but other objects must..
Any help would be appreciated!
Joined: Oct 14, 2005
Feb 13, 2009 20:43:51
Nope. XML parsers aren't allowed to "fix" incorrect data, they are required to terminate when they reach the first error.
But you have well-formed XML, don't you? So you could write your own code to remove data which you deem to be incorrect.
It is sorta covered in the
JavaRanch Style Guide
subject: XML and java beans
Struts2 POJO population from URL
xml to java objects
K &B String Doubt
convert javaobjects to xml and xml to java objects dynamically
Facade design pattern in web services
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014