use of org.apache.tika.parser.microsoft.ooxml.OOXMLWordAndPowerPointTextHandler in project tika by apache.
the class XWPFEventBasedWordExtractor method handlePart.
private void handlePart(PackagePart packagePart, XWPFListManager xwpfListManager, StringBuilder buffer) throws IOException, SAXException {
Map<String, String> hyperlinks = loadHyperlinkRelationships(packagePart);
try (InputStream stream = packagePart.getInputStream()) {
XMLReader reader = SAXHelper.newXMLReader();
reader.setContentHandler(new OOXMLWordAndPowerPointTextHandler(new XWPFToTextContentHandler(buffer), hyperlinks));
reader.parse(new InputSource(new CloseShieldInputStream(stream)));
} catch (ParserConfigurationException e) {
LOG.warn("Can't configure XMLReader", e);
}
}
Aggregations