-2

I have Excel spreadsheet xml file(generated from excel via save as Excel XML Spreadsheet 2003) and I need to extract data from it in java.

I found similar topic: How to load old Microsoft Office XML file (Excel) using Java

But last answer was 2 years ago - something could change.

If you have any idea how to parse excel xml file(or convert it) please let me know.

Thanks in advance.

Community
  • 1
  • 1
Jan Kusy
  • 29
  • 2
  • 5

2 Answers2

1

I had the same problem some time ago, ended up writing a SAX parser to read the XML file. I wrote a blog post about it here.

You can find the sample project to parse the file in Github.

Gus
  • 4,437
  • 2
  • 24
  • 27
0

You can for sure export your Excel file into pure XML. Then it will be various libs for that:

You should also read this topic: Best way to read XML in Java
Enjoy

EDIT
If you need to extract data from Excel XML then your file has extention XLS, right?
The you can use easly - jXLS

Community
  • 1
  • 1
Maniek
  • 67
  • 5
  • I know I can export excel file into pure XML but I have already generated files as Excel XML Spreadsheet 2003(It was not done by me, but I must proceed with this files). – Jan Kusy May 09 '13 at 07:49
  • Then try jXLS library -> link in answer above – Maniek May 09 '13 at 08:06
  • I tied jXLS: List testKist = new ArrayList(); testKist.add("test"); Map beans = new HashMap(); beans.put("departments", testKist); XLSTransformer transformer = new XLSTransformer(); transformer.transformXLS(filePath, beans, "C:" + File.separator + "text.xls"); but I get: java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream as source file I put my excel xml file. – Jan Kusy May 09 '13 at 08:46