Converting an XML document to an Excel spreadsheet
In this section we convert an example XML document to an Excel document with the Apache HSSF API in the XMLToExcel.java
application. The example document, catalog.xml
, is listed as follows:
<?xml version="1.0" encoding="UTF-8"?> <catalog> <journal> <journal-title>Oracle Magazine</journal-title> <publisher>Oracle Publishing</publisher> <section>COMMENT</section> <edition>November-December 2008</edition> <title>Application Server Convergence</title> <author>David Baum</author> </journal> <journal> <journal-title>Oracle Magazine</journal-title> <publisher>Oracle Publishing</publisher> <section>Technology</section> <edition>March-April 2008</edition> <title>Oracle Database 11g Redux</title> <author>Tom Kyte</author> </journal> </catalog>
Copy the catalog.xml
...