Apache Ant/Converting Excel to XML

Motivation
You want to automatically extract a well-formed XML file from a binary Excel document.

Method
We will us the java Ant task within a build target.

Input File
We will create a sample Microsoft Excel file that has two columns like the following: Save this into a file 'sample.xls'.

Next, download the Apache Tika jar file and put is on your local hard drive.

You can get the downloads from here: http://tika.apache.org/download.html the Main Tika jar file is about 27MB.

I put the tika jar file in D:\Apps\tika but you can change this.

Create a file called "build.xml"

Sample Output
Note that the output is a well formed HTML file with a table in it: