Hello I am trying to add comment to a docx document if a table is not having caption in its immediate next paragraph tag.
code
public boolean validateTableForCaption(Tbl table) throws Exception{
int index = content.indexOf(table.getParent());
//check immediate next element is paragraph containing caption
Object nextContent = content.get(++index);
if(nextContent instanceof P){
P nextPara = (P) nextContent;
PPr paraProperties = nextPara.getPPr();
if(paraProperties == null){
return false;
}else{
PStyle style = paraProperties.getPStyle();
if(style == null){
return false;
}else ...