use of org.apache.poi.xssf.extractor.XSSFExportToXml in project poi by apache.
the class CustomXMLMapping method main.
public static void main(String[] args) throws Exception {
OPCPackage pkg = OPCPackage.open(args[0]);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
for (XSSFMap map : wb.getCustomXMLMappings()) {
XSSFExportToXml exporter = new XSSFExportToXml(map);
ByteArrayOutputStream os = new ByteArrayOutputStream();
exporter.exportToXML(os, true);
String xml = os.toString("UTF-8");
System.out.println(xml);
}
pkg.close();
}
use of org.apache.poi.xssf.extractor.XSSFExportToXml in project poi by apache.
the class XSSFFileHandler method exportToXML.
private void exportToXML(XSSFWorkbook wb) throws SAXException, ParserConfigurationException, TransformerException {
for (XSSFMap map : wb.getCustomXMLMappings()) {
XSSFExportToXml exporter = new XSSFExportToXml(map);
ByteArrayOutputStream os = new ByteArrayOutputStream();
exporter.exportToXML(os, true);
}
}
Aggregations