-1

Possible Duplicate:
Java converting XML to Java objects

Hi,

Can someone please suggest the best and different ways of converting a XML file to an Java object?

Thanks & Regards, Ravi.

Community
  • 1
  • 1
Ravi
  • 1,082
  • 4
  • 15
  • 24
  • duplicate of question : http://stackoverflow.com/questions/3276149/java-converting-xml-to-java-objects/3276551#3276551 – Tushar Tarkas Aug 05 '10 at 11:54
  • 1
    Please search the relevant question before posting it. – Tushar Tarkas Aug 05 '10 at 11:55
  • Tushar, its not the same. What I am looking for is that if I only have the XML file, no object, then what can I use which can create the java Class for me. – Ravi Aug 05 '10 at 13:32

2 Answers2

0

You can user available frameworks like Castor or Xstream

I would recommend Xstream considering the simplicity of use. This 2 minute tutorial of Xstream will help you to get started quickly.

Gopi
  • 10,073
  • 4
  • 31
  • 45
  • If I am not wrong, Castor need the XML Schema if you were to create the java object, not sure same for Sstream. Actually, what I am looking for is that if I only have the XML file, no object, then what can I use which can create the java Class for me. – Ravi Aug 05 '10 at 13:15
0

There are a lot of xml-to-java-frameworks around. In the past I've worked a lot with jibx.

Kurt Du Bois
  • 7,550
  • 4
  • 25
  • 33