document = builder.parse(new InputSource(new ByteArrayInputStream(data)));
} catch (Exception e) {
InputStreamReader reader = new InputStreamReader(new ByteArrayInputStream(data), "ISO-8859-1");
document = builder.parse(new InputSource(reader));
}
AtomFeed feed = new AtomFeed(document);
FeedFormatter formatter = new FeedFormatter(feed, (Feed)jxl.getDocuments()[0]);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(new DOMSource(formatter.getIndexDocument()),
new StreamResult(new File(file.getParentFile(),"index.html")));
for (int i = 0, n = feed.getItems().length; i < n; i++) {
transformer.transform(new DOMSource(formatter.getItemDocuments()[i]),
new StreamResult(new File(file.getParentFile(),"item" + (i+1) + ".html")));
}
}