This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
jodconverter is a nice library that uses OO to covert between file formats. Since OO understands ODF (of which ODT is part) it might help.
If you want a more direct approach, ODF (and ODT) files are XML files in a zip archive. So you can use the java.util.zip package to open the file, and then process its constituent files using the JAXP API. The file that has the actual content is called "content.xml".
while its true that they are just zip'd XML files, one quick look at the structure of the XML is enough to make one run away and hide.
Thar be dragons....
Joined: Mar 22, 2005
I found the ODF format rather straightforward to deal with. More for the learning effect than for the practical use I wrote an ODS->XLS converter and ODT->PDF/RTF/HTML converter a while ago.
The trickiest part was to reconcile the various styles that get applied, because there are default styles, document default styles, paragraph styles, local styles, etc., and you need to make sure which one gets applied to a particular piece of data.
Processing the actual text or cell contents was comparatively easy.