Page 1 of 1

Support for XLSX SpreadsheetML

PostPosted: Tue Sep 07, 2010 10:59 am
by jason
As of now, docx4j can create, load and save OpenXML SpreadsheetML packages.

"Why would you use docx4j to do this", I hear you ask, "rather than POI, which focuses on xlsx and binary xls?"

Probably because you like JAXB (as opposed to XML Beans), or you are already using docx4j for docx or pptx, and need to be able to do some stuff with xlsx as well.

Another possible reason is that the jar XML Beans generates from the OpenXML schemas is too big for your purposes. (To get around this, POI offers a 'lite' subset: the 'big' ooxml-schemas-1.0.jar is 14.5 MB! But if you need to support arbitrary spreadsheets, you'll probably need the complete jar). In contrast, the whole of docx4j/pptx4j/xlsx4j weighs in at about the same as POI's lite subset.

If you are processing spreadsheets only (ie not docx or pptx), and preceding paragraph is not a concern for you, then you would probably be best off using POI.

Anyway, the xlsx4j code is in svn in src/xlsx4j/java

Using the same approach as for docx documents, it represents each part as a JAXB content tree.

For examples, please see http://dev.plutext.org/trac/docx4j/brow ... 4j/samples

All the code you need is in docx4j (docx4j-nightly-20100907.jar or later). xlsx4j will be included in the next formal release.

For new users, please see also the docx4j Getting Started guide, available at http://dev.plutext.org/svn/docx4j/trunk/docx4j/docs/