Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java XML parser to parse the XML file

 
Anshul Chandra Saxena
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a requirement wherein i have to parse an XML file and generate a new XML file out of that.

My XML file looks like this



My file has many entries like these. Now i have to parse this XML file and have to produce an output like this for all the entries:



Can anyone please help me with this.

thanks
Anshul

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to transform one XML format into another XML format then I think using XSLT would be a good choice.
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.xml.transform.TransformerFactory and javax.xml.transform.Transformer should be able to help you out:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic