use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMapInfo in project poi by apache.
the class TestMapInfo method testMapInfoExists.
public void testMapInfoExists() {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx");
MapInfo mapInfo = null;
SingleXmlCells singleXMLCells = null;
for (POIXMLDocumentPart p : wb.getRelations()) {
if (p instanceof MapInfo) {
mapInfo = (MapInfo) p;
CTMapInfo ctMapInfo = mapInfo.getCTMapInfo();
assertNotNull(ctMapInfo);
assertEquals(1, ctMapInfo.sizeOfSchemaArray());
for (XSSFMap map : mapInfo.getAllXSSFMaps()) {
Node xmlSchema = map.getSchema();
assertNotNull(xmlSchema);
}
}
}
XSSFSheet sheet1 = wb.getSheetAt(0);
for (POIXMLDocumentPart p : sheet1.getRelations()) {
if (p instanceof SingleXmlCells) {
singleXMLCells = (SingleXmlCells) p;
}
}
assertNotNull(mapInfo);
assertNotNull(singleXMLCells);
}
Aggregations