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);
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
