• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xls to xml conversion application

 
sai rama krishna
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a xls file with two sheets namely sheet1 and sheet2

sheet 1 having 3 columns say

1. product 2. total 3. cost
has about 100 records


sheet2 also having same 3 columns say

1. product 2. total 3. cost
has about 10 records.

I need to convert above xls to xml with similar structure as follows


<sheet1>
<product1>
<product></product>
<total></total>
<cost></cost>
</product1>
<product2>
<product></product>
<total></total>
<cost></cost>
</product2>
.....more products
</sheet1>

<sheet2>
<product1>
<product></product>
<total></total>
<cost></cost>
</product1>
<product2>
<product></product>
<total></total>
<cost></cost>
</product2>
.....more products
</sheet2>

what is the best way to achieve it. Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance



 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Apache POI to read the file, and then use any number of XML APIs to write it, like DOM, JDom, XOM etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic