Example usage for org.apache.poi.xssf.usermodel XSSFWorkbook getCustomXMLMappings

List of usage examples for org.apache.poi.xssf.usermodel XSSFWorkbook getCustomXMLMappings

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFWorkbook getCustomXMLMappings.

Prototype

public Collection<XSSFMap> getCustomXMLMappings() 

Source Link

Usage

From source file:packtest.CustomXMLMapping.java

License:Apache License

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);/*  ww w .j a v  a  2 s.c  om*/
        String xml = os.toString("UTF-8");
        System.out.println(xml);
    }
    pkg.close();
}