FieldsDocumentPart docPart, PicturesSource pictures, PicturesTable pictureTable,
XHTMLContentHandler xhtml) throws SAXException, IOException, TikaException {
// Note - a poi bug means we can't currently properly recurse
// into nested tables, so currently we don't
if(p.isInTable() && p.getTableLevel() > parentTableLevel && parentTableLevel==0) {
Table t = r.getTable(p);
xhtml.startElement("table");
xhtml.startElement("tbody");
for(int rn=0; rn<t.numRows(); rn++) {
TableRow row = t.getRow(rn);
xhtml.startElement("tr");
for(int cn=0; cn<row.numCells(); cn++) {
TableCell cell = row.getCell(cn);
xhtml.startElement("td");
for(int pn=0; pn<cell.numParagraphs(); pn++) {
Paragraph cellP = cell.getParagraph(pn);
handleParagraph(cellP, p.getTableLevel(), cell, document, docPart, pictures, pictureTable, xhtml);
}
xhtml.endElement("td");
}
xhtml.endElement("tr");
}
xhtml.endElement("tbody");
xhtml.endElement("table");
return (t.numParagraphs()-1);
}
String text = p.text();
if (text.replaceAll("[\\r\\n\\s]+", "").isEmpty()) {
// Skip empty paragraphs