I need to parse a xml file using JAVA and have to create a bean out of that xml file after parsing .
I need this while using Spring JMS in which producer is producing a xml file .First I need to read the xml file and take action according .
I read some thing about parsing and come with these option
- xpath
- DOM
Which ll be the best option to parse the xml file.
Looks like, you receive a serialized object via Java messaging. Have a look first, how the object is being serialized. Usually this is done with a library (jaxb, axis, …) and you could use the very same library to create a deserializer.
You will need:
Then, usually the library will create all helper classes and files and you don’t have to care about parsing.