You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nir Moatty <Ni...@tecnomatix.com> on 2004/07/14 20:36:57 UTC
HSSFSerializer Question
Hello,
I would like to use the HSSFSerializer in a standalone environment.
I just run a java application than load an xml document in a gnumeric
format.
Then I use the HSSFSerializer to parse it and tranform it into excel
format.
My code looks like this:
HSSFSerializer serializer = new HSSFSerializer();
FileOutputStream file = new FileOutputStream("c:\\temp\\book.xls");
serializer.initialize();
serializer.getMimeType();
serializer.setOutputStream(file);
FileInputStream in = new FileInputStream("c:\\temp\\mine.xml");
SAXParserFactory factory= SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
parser.getXMLReader().setContentHandler(serializer);
parser.getXMLReader().parse("c:\\temp\\myBook.xml");
I get a corrupted xls file as a result.
Am I doing something wrong?
Cheers
Nir
***************************************************************************************************
The information contained in this message is proprietary of Tecnomatix, protected
from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s) of the
message. If the reader of this message is not the intended recipient, you are hereby
notified that any dissemination, use, distribution or copying of this communication is
strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.
***************************************************************************************************
001