2

I am working on this functionality for the first time. I tried to implement the StaxEventItemReader, but it didn't worked. Can any of you suggest me some way to read and write the XML file, in Java, using Spring Batch approach?

Many Thanks in advance!

My XML is :

<EmployeeDetails>
   <employee id = 1>
       <benefit value =1 code = Hi>
       <benefit value =1 code = Hello>
       <benefit value =1 code = Help>
   <employee/>
   <employee id = 2>
       <benefit value =9 code = Hi>
       <benefit value =8 code = Hello>
       <benefit value =8 code = Help>
   <employee/>
<EmployeeDetails/>

Here, I just need to read the attributes where my root element is EmployeeDetails. I followed two blogs, ReadXMLAndWriteDataIntoDataBase and SpringBatchWebsiteForXMLItemReadersAndWriters. I used them, but neither worked for me. I will also update my code in few hours. Thanks!

Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66
  • Please try to add some code snippet that you have written otherwise the kind of sample/example you asked can be found in web. – Abhishek Chatterjee Jul 31 '20 at 10:29
  • @AbhishekChatterjee THanks for replying, I have updated my question. Hope it will help you to understand my requirement. Will update the code as well. Thanks! – Kapil Pateriya Aug 01 '20 at 10:04

0 Answers0