XML & Web services: Creating Java Classes from XML
Hi All, i have an XML file the format of which is not defined it can be a dynamically generated XML file is it possible to create a dynamic java files(JAVA BEANS) so that they will get populated with the data the XML have?? if it is feasible please suggest the way to do this thanks in advance -u
- Posted by: Umesh Awasthi
- Posted on: February 04 2009 06:12 EST
This is a famous code generation technique and now being implemented by almost all the framework. Waht you need to do is to use of reflection and XML APIs.
There is a solution for this. visit http://www.castor.org/xml-framework.html www castor dot org slash xml hyphen framework dot html this is simple and powerful.
You may want to look at Shipka JDF as well. It gives you a lot of flexibilities converting XML into JAVA objects including validations, conversions, triggering actions if certain condition is met, etc. Dimitre http://shipka.com