use of org.openxmlformats.schemas.wordprocessingml.x2006.main.StylesDocument in project poi by apache.
the class XWPFStyles method onDocumentRead.
/**
* Read document
*/
@Override
protected void onDocumentRead() throws IOException {
StylesDocument stylesDoc;
InputStream is = getPackagePart().getInputStream();
try {
stylesDoc = StylesDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
setStyles(stylesDoc.getStyles());
latentStyles = new XWPFLatentStyles(ctStyles.getLatentStyles(), this);
} catch (XmlException e) {
throw new POIXMLException("Unable to read styles", e);
} finally {
is.close();
}
}
Aggregations