Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Apache POI to write out XML from Excel

I have a need to convert my excel files into XML. Currently I have a tool that uses POI that spits out 2010 excel files (xlsx), but I would like to extend that further and have it spit out XML as well.

I can't seem to find any explicit examples of how to do that in POI, but searching suggests it is possible. Was hoping someone would have some direct experience with this?

thanks!

like image 401
rkd80 Avatar asked Dec 10 '12 16:12

rkd80


2 Answers

I've never used POI directly, though I've used Apache Tika (which implements POI) to do something similar. The parser/handler interface automatically converts a document into XML which you should be able to adjust for your own purposes.

https://tika.apache.org/1.2/parser.html

like image 105
winchella Avatar answered Oct 24 '22 10:10

winchella


Check out www.servingxml.com. It converts excel/csv to XML. No Java code involved. All you have to create transformation xml file which is very easy to do. Lots of examples in the site.

like image 28
mavrav Avatar answered Oct 24 '22 08:10

mavrav