Program: 36972
Project: 36972
Buggy source:
/** 
 * Process table with subheaders without header.
 * @param cells the cells
 * @param table the table
 * @param art the art
 * @param tableFileName the table file name
 */
private Table processTableWithSubheadersWithoutHeader(Cell[][] cells,Table table,Article art,String tableFileName){
  if (!hasTableSubheader(cells,table)) {
    return table;
  }
  if (table.getTableStructureType() != Table.StructureType.SUBHEADER && table.getTableStructureType() != null) {
    return table;
  }
  Statistics.addSubheaderTable();
  table.setTableStructureType(Table.StructureType.SUBHEADER);
  if (TablInExMain.ExportLinkedData) {
    TablInExMain.linkedData.AddTable(table.getTable_title(),table.getTable_caption(),"String_Node_Str","String_Node_Str",table.getTable_footer(),table.getXml());
  }
  String[] headerStackA=new String[20];
  String[] headerStackIndexes=new String[20];
  int currentSubHeaderLevel=0;
  String prevSubheader="String_Node_Str";
  String prevSubheaderIndex="String_Node_Str";
  boolean hasSpaceSubheaders=false;
  if (table.isHasHeader() == false) {
    table=checkHeaders(table);
  }
  cells=table.cells;
  Cell[][] original_cells=table.original_cells;
  for (int j=0; j < cells.length; j++) {
    if (cells[j][0].isIs_header())     continue;
    boolean emptyLine=true;
    for (int h=0; h < cells[j].length; h++) {
      if (!Utilities.isSpaceOrEmpty(cells[j][h].getCell_content())) {
        emptyLine=false;
        break;
      }
    }
    if (emptyLine)     continue;
    if (cells[j][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[j][0].getCells_columnspanning() >= table.getNum_of_columns()) {
      if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
        currentSubHeaderLevel++;
      }
 else {
        currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
        currentSubHeaderLevel++;
      }
      SetUnderSubheaderRow(cells[j]);
      SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
      continue;
    }
    boolean emptyCells=true;
    for (int h=1; h < cells[j].length; h++) {
      if (cells[j][h].getCell_content() == null) {
        cells[j][h].setCell_content("String_Node_Str");
      }
      if (Utilities.isSpaceOrEmpty(cells[j][0].getCell_content()) || !Utilities.isSpaceOrEmpty(cells[j][h].getCell_content())) {
        emptyCells=false;
      }
    }
    if (emptyCells) {
      if (currentSubHeaderLevel != 0 && currentSubHeaderLevel == j - 1) {
        if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
 else {
          currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
      }
 else {
        if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
 else {
          currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
        if (j > 0 && isRowSubheader(cells[j - 1],table)) {
          prevSubheader=cells[j - 1][0].getCell_content();
          prevSubheaderIndex=cells[j - 1][0].getRow_number() + cells[j - 1][0].getColumn_number() + "String_Node_Str";
        }
        continue;
      }
    }
    if (isRowSubheader(cells[j],table)) {
      if (j > 0 && isRowSubheader(cells[j - 1],table)) {
        prevSubheader=cells[j - 1][0].getCell_content();
        prevSubheaderIndex=cells[j - 1][0].getRow_number() + cells[j - 1][0].getColumn_number() + "String_Node_Str";
      }
      continue;
    }
    if (cells[j][0].getCell_content() == null) {
      cells[j][0].setCell_content("String_Node_Str");
    }
    if ((cells != null && cells[j] != null && cells[j][0] != null && cells[j][0].getCell_content() != null) && (cells[j][0].getCell_content().length() > 0 && Utilities.isSpace(cells[j][0].getCell_content().trim().charAt(0))) || Utilities.isSpaceOrEmpty(cells[j][0].getCell_content())) {
      hasSpaceSubheaders=true;
      SetUnderSubheaderRow(cells[j]);
      SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
      if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel || Utilities.isSpaceOrEmpty(cells[j][0].getCell_content())) {
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
      }
 else {
        currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
      }
    }
 else {
      if (hasSpaceSubheaders)       currentSubHeaderLevel=0;
      headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
      headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
    }
    for (int k=1; k < cells[j].length; k++) {
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
        Document doc=docBuilder.newDocument();
        Element rootElement=doc.createElement("String_Node_Str");
        doc.appendChild(rootElement);
        Element cell=doc.createElement("String_Node_Str");
        rootElement.appendChild(cell);
        Element NavigationPath=doc.createElement("String_Node_Str");
        if (!Utilities.isSpaceOrEmpty(cells[0][0].getCell_content()) && cells[0][0].isIs_header()) {
          Element Head00=doc.createElement("String_Node_Str");
          Head00.setTextContent(cells[0][0].getCell_content());
          cells[j][k].setHead00(cells[0][0].getCell_content());
          NavigationPath.appendChild(Head00);
        }
        Element Stub=doc.createElement("String_Node_Str");
        if (currentSubHeaderLevel > 0) {
          getStackAsElements(headerStackA,prevSubheader,currentSubHeaderLevel,doc,Stub);
          getStackIndex(headerStackIndexes,prevSubheaderIndex,currentSubHeaderLevel,cells[j][k],table);
        }
        String subheaderValues="String_Node_Str";
        String[] SubHeaders=new String[Stub.getChildNodes().getLength()];
        for (int l=0; l < Stub.getChildNodes().getLength(); l++) {
          subheaderValues+="String_Node_Str" + Stub.getChildNodes().item(l).getTextContent();
          SubHeaders[l]=Stub.getChildNodes().item(l).getTextContent();
        }
        cells[j][k].setSubheader_values(subheaderValues);
        Element ss=doc.createElement("String_Node_Str");
        ss.setTextContent(cells[j][0].getCell_content());
        cells[j][k].setStub_values(cells[j][0].getCell_content());
        Stub.appendChild(ss);
        NavigationPath.appendChild(Stub);
        if (cells[0][k].isIs_header()) {
          for (int s=0; s < cells[0][k].headers.size(); s++) {
            Element Header=doc.createElement("String_Node_Str" + s);
            Header.setTextContent(cells[0][k].headers.get(s));
            cells[j][k].setHeader_values(cells[0][k].getCell_content());
            NavigationPath.appendChild(Header);
          }
        }
        cell.appendChild(NavigationPath);
        Element info=doc.createElement("String_Node_Str");
        info.setTextContent(cells[j][k].getCell_content());
        cell.appendChild(info);
        Element CellType=doc.createElement("String_Node_Str");
        CellType.setTextContent(cells[j][k].getCellType());
        cell.appendChild(CellType);
        Element tableEl=doc.createElement("String_Node_Str");
        rootElement.appendChild(tableEl);
        Element tname=doc.createElement("String_Node_Str");
        tname.setTextContent(table.getTable_caption());
        tableEl.appendChild(tname);
        Element TableType=doc.createElement("String_Node_Str");
        TableType.setTextContent("String_Node_Str");
        tableEl.appendChild(TableType);
        Element torder=doc.createElement("String_Node_Str");
        torder.setTextContent(table.getTable_title());
        tableEl.appendChild(torder);
        Element tfooter=doc.createElement("String_Node_Str");
        tfooter.setTextContent(table.getTable_footer());
        tableEl.appendChild(tfooter);
        Element document=doc.createElement("String_Node_Str");
        rootElement.appendChild(document);
        Element docTitle=doc.createElement("String_Node_Str");
        docTitle.setTextContent(art.getTitle());
        document.appendChild(docTitle);
        Element pmc=doc.createElement("String_Node_Str");
        pmc.setTextContent(art.getPmc());
        document.appendChild(pmc);
        if (TablInExMain.ExportLinkedData) {
          TablInExMain.linkedData.AddCell(cells[j][0].getCell_content(),SubHeaders,cells[j][k].getCell_content(),cells[j][k].getCellType(),cells[0][k].headers.toArray(new String[0]),cells[0][0].getCell_content(),j,k);
        }
        DataExtractionOutputObj dataExtObj=new DataExtractionOutputObj(folder + tableFileName + "String_Node_Str"+ j+ "String_Node_Str"+ k+ "String_Node_Str",doc);
        table.output.add(dataExtObj);
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
    }
  }
  table.cells=cells;
  return table;
}

Fixed version (ground truth):
/** 
 * Process table with subheaders without header.
 * @param cells the cells
 * @param table the table
 * @param art the art
 * @param tableFileName the table file name
 */
private Table processTableWithSubheadersWithoutHeader(Cell[][] cells,Table table,Article art,String tableFileName){
  if (!hasTableSubheader(cells,table)) {
    return table;
  }
  if (table.getTableStructureType() != Table.StructureType.SUBHEADER && table.getTableStructureType() != null) {
    return table;
  }
  Statistics.addSubheaderTable();
  table.setTableStructureType(Table.StructureType.SUBHEADER);
  if (TablInExMain.ExportLinkedData) {
    TablInExMain.linkedData.AddTable(table.getTable_title(),table.getTable_caption(),"String_Node_Str","String_Node_Str",table.getTable_footer(),table.getXml());
  }
  String[] headerStackA=new String[20];
  String[] headerStackIndexes=new String[20];
  int currentSubHeaderLevel=0;
  String prevSubheader="String_Node_Str";
  String prevSubheaderIndex="String_Node_Str";
  boolean hasSpaceSubheaders=false;
  if (table.isHasHeader() == false) {
    table=checkHeaders(table);
  }
  cells=table.cells;
  Cell[][] original_cells=table.original_cells;
  for (int j=0; j < cells.length; j++) {
    if (cells[j][0].isIs_header())     continue;
    boolean emptyLine=true;
    for (int h=0; h < cells[j].length; h++) {
      if (!Utilities.isSpaceOrEmpty(cells[j][h].getCell_content())) {
        emptyLine=false;
        break;
      }
    }
    if (emptyLine)     continue;
    if (cells[j][0].isIs_columnspanning() && table.getNum_of_columns() > 1 && cells[j][0].getCells_columnspanning() >= table.getNum_of_columns()) {
      if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
        currentSubHeaderLevel++;
      }
 else {
        currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
        currentSubHeaderLevel++;
      }
      SetUnderSubheaderRow(cells[j]);
      SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
      continue;
    }
    boolean emptyCells=true;
    for (int h=1; h < cells[j].length; h++) {
      if (cells[j][h].getCell_content() == null) {
        cells[j][h].setCell_content("String_Node_Str");
      }
      if (Utilities.isSpaceOrEmpty(cells[j][0].getCell_content()) || !Utilities.isSpaceOrEmpty(cells[j][h].getCell_content())) {
        emptyCells=false;
      }
    }
    if (emptyCells) {
      if (currentSubHeaderLevel != 0 && currentSubHeaderLevel == j - 1) {
        if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
 else {
          currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
      }
 else {
        if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel) {
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
 else {
          currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
          headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
          headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
          currentSubHeaderLevel++;
          SetUnderSubheaderRow(cells[j]);
          SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
        }
        if (j > 0 && isRowSubheader(cells[j - 1],table)) {
          prevSubheader=cells[j - 1][0].getCell_content();
          prevSubheaderIndex=cells[j - 1][0].getRow_number() + cells[j - 1][0].getColumn_number() + "String_Node_Str";
        }
        continue;
      }
    }
    if (isRowSubheader(cells[j],table)) {
      if (j > 0 && isRowSubheader(cells[j - 1],table)) {
        prevSubheader=cells[j - 1][0].getCell_content();
        prevSubheaderIndex=cells[j - 1][0].getRow_number() + cells[j - 1][0].getColumn_number() + "String_Node_Str";
      }
      continue;
    }
    if (cells[j][0].getCell_content() == null) {
      cells[j][0].setCell_content("String_Node_Str");
    }
    if ((cells != null && cells[j] != null && cells[j][0] != null && cells[j][0].getCell_content() != null) && (cells[j][0].getCell_content().length() > 0 && Utilities.isSpace(cells[j][0].getCell_content().trim().charAt(0)))) {
      hasSpaceSubheaders=true;
      SetUnderSubheaderRow(cells[j]);
      SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()]);
      if (Utilities.numOfBegeningSpaces(cells[j][0].getCell_content()) == currentSubHeaderLevel || Utilities.isSpaceOrEmpty(cells[j][0].getCell_content())) {
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
      }
 else {
        currentSubHeaderLevel=Utilities.numOfBegeningSpaces(cells[j][0].getCell_content());
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
      }
    }
 else {
      if (hasSpaceSubheaders)       currentSubHeaderLevel=0;
      if (Utilities.isSpaceOrEmpty(cells[j][0].getCell_content())) {
        SetUnderSubheaderRow(cells[j],headerStackIndexes[currentSubHeaderLevel]);
        SetUnderSubheaderRow(original_cells[cells[j][0].getRow_number()],headerStackIndexes[currentSubHeaderLevel]);
      }
 else {
        headerStackA[currentSubHeaderLevel]=cells[j][0].getCell_content();
        headerStackIndexes[currentSubHeaderLevel]="String_Node_Str" + original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getRow_number() + "String_Node_Str"+ original_cells[cells[j][0].getRow_number()][cells[j][0].getColumn_number()].getColumn_number();
      }
    }
    for (int k=1; k < cells[j].length; k++) {
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
        Document doc=docBuilder.newDocument();
        Element rootElement=doc.createElement("String_Node_Str");
        doc.appendChild(rootElement);
        Element cell=doc.createElement("String_Node_Str");
        rootElement.appendChild(cell);
        Element NavigationPath=doc.createElement("String_Node_Str");
        if (!Utilities.isSpaceOrEmpty(cells[0][0].getCell_content()) && cells[0][0].isIs_header()) {
          Element Head00=doc.createElement("String_Node_Str");
          Head00.setTextContent(cells[0][0].getCell_content());
          cells[j][k].setHead00(cells[0][0].getCell_content());
          NavigationPath.appendChild(Head00);
        }
        Element Stub=doc.createElement("String_Node_Str");
        if (currentSubHeaderLevel > 0) {
          getStackAsElements(headerStackA,prevSubheader,currentSubHeaderLevel,doc,Stub);
          getStackIndex(headerStackIndexes,prevSubheaderIndex,currentSubHeaderLevel,cells[j][k],table);
        }
        String subheaderValues="String_Node_Str";
        String[] SubHeaders=new String[Stub.getChildNodes().getLength()];
        for (int l=0; l < Stub.getChildNodes().getLength(); l++) {
          subheaderValues+="String_Node_Str" + Stub.getChildNodes().item(l).getTextContent();
          SubHeaders[l]=Stub.getChildNodes().item(l).getTextContent();
        }
        cells[j][k].setSubheader_values(subheaderValues);
        Element ss=doc.createElement("String_Node_Str");
        ss.setTextContent(cells[j][0].getCell_content());
        cells[j][k].setStub_values(cells[j][0].getCell_content());
        Stub.appendChild(ss);
        NavigationPath.appendChild(Stub);
        if (cells[0][k].isIs_header()) {
          for (int s=0; s < cells[0][k].headers.size(); s++) {
            Element Header=doc.createElement("String_Node_Str" + s);
            Header.setTextContent(cells[0][k].headers.get(s));
            cells[j][k].setHeader_values(cells[0][k].getCell_content());
            NavigationPath.appendChild(Header);
          }
        }
        cell.appendChild(NavigationPath);
        Element info=doc.createElement("String_Node_Str");
        info.setTextContent(cells[j][k].getCell_content());
        cell.appendChild(info);
        Element CellType=doc.createElement("String_Node_Str");
        CellType.setTextContent(cells[j][k].getCellType());
        cell.appendChild(CellType);
        Element tableEl=doc.createElement("String_Node_Str");
        rootElement.appendChild(tableEl);
        Element tname=doc.createElement("String_Node_Str");
        tname.setTextContent(table.getTable_caption());
        tableEl.appendChild(tname);
        Element TableType=doc.createElement("String_Node_Str");
        TableType.setTextContent("String_Node_Str");
        tableEl.appendChild(TableType);
        Element torder=doc.createElement("String_Node_Str");
        torder.setTextContent(table.getTable_title());
        tableEl.appendChild(torder);
        Element tfooter=doc.createElement("String_Node_Str");
        tfooter.setTextContent(table.getTable_footer());
        tableEl.appendChild(tfooter);
        Element document=doc.createElement("String_Node_Str");
        rootElement.appendChild(document);
        Element docTitle=doc.createElement("String_Node_Str");
        docTitle.setTextContent(art.getTitle());
        document.appendChild(docTitle);
        Element pmc=doc.createElement("String_Node_Str");
        pmc.setTextContent(art.getPmc());
        document.appendChild(pmc);
        if (TablInExMain.ExportLinkedData) {
          TablInExMain.linkedData.AddCell(cells[j][0].getCell_content(),SubHeaders,cells[j][k].getCell_content(),cells[j][k].getCellType(),cells[0][k].headers.toArray(new String[0]),cells[0][0].getCell_content(),j,k);
        }
        DataExtractionOutputObj dataExtObj=new DataExtractionOutputObj(folder + tableFileName + "String_Node_Str"+ j+ "String_Node_Str"+ k+ "String_Node_Str",doc);
        table.output.add(dataExtObj);
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
    }
  }
  table.cells=cells;
  return table;
}