Program: 36996
Project: 36996
Buggy source:
public void MetamapTagDocument(){
  NodeList Head00=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList HeaderValue=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList Stub=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList value=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList CellType=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList TableType=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableName=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableOrder=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableFooter=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList DocumentTitle=XMLDocument.getElementsByTagName("String_Node_Str");
  try {
    NodeList PMC=XMLDocument.getElementsByTagName("String_Node_Str");
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    Document doc=docBuilder.newDocument();
    String Head00Str="String_Node_Str";
    String HeaderValueStr="String_Node_Str";
    String[] Subheaders;
    String StubValue="String_Node_Str";
    String valueStr="String_Node_Str";
    String CellTypeStr="String_Node_Str";
    String TableTypeStr="String_Node_Str";
    String TableNameStr="String_Node_Str";
    String TableOrderStr="String_Node_Str";
    String TableFooterStr="String_Node_Str";
    String DocumentTitleStr="String_Node_Str";
    String PMCStr="String_Node_Str";
    Head00Str=Head00.item(0).getTextContent();
    Head00Str=Head00Str.replaceAll("String_Node_Str","String_Node_Str");
    MetaMapping mp=new MetaMapping();
    System.out.print("String_Node_Str");
    Map<Object,Object> aMap=mp.getClassification(Head00Str);
    System.out.println("String_Node_Str");
    Element RootElement=doc.createElement("String_Node_Str");
    Element Cell=doc.createElement("String_Node_Str");
    RootElement.appendChild(Cell);
    Element NavigationPath=doc.createElement("String_Node_Str");
    Cell.appendChild(NavigationPath);
    doc.appendChild(RootElement);
    Element Head00e=doc.createElement("String_Node_Str");
    int lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      lastY=X + Y;
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        Text tn=doc.createTextNode(Head00Str.substring(lastY,X));
        Head00e.appendChild(tn);
      }
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddHead00MMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(Head00Str.substring(X,X + Y));
      Head00e.appendChild(HeadPart);
    }
    Text tn=doc.createTextNode(Head00Str.substring(lastY,Head00Str.length()));
    Head00e.appendChild(tn);
    NavigationPath.appendChild(Head00e);
    HeaderValueStr=HeaderValue.item(0).getTextContent();
    HeaderValueStr=HeaderValueStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(HeaderValueStr);
    System.out.println("String_Node_Str");
    Element HeaderValuee=doc.createElement("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(HeaderValueStr.substring(lastY,X));
        HeaderValuee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddHeaderMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(HeaderValueStr.substring(X,X + Y));
      HeaderValuee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(HeaderValueStr.substring(lastY,HeaderValueStr.length()));
    HeaderValuee.appendChild(tn);
    NavigationPath.appendChild(HeaderValuee);
    Element Stube=doc.createElement("String_Node_Str");
    NavigationPath.appendChild(Stube);
    NodeList stubVals=Stub.item(0).getChildNodes();
    for (int j=0; j < stubVals.getLength(); j++) {
      String nodeName=stubVals.item(j).getNodeName();
      String nodeValue=stubVals.item(j).getTextContent();
      nodeValue=nodeValue.replaceAll("String_Node_Str","String_Node_Str");
      mp=new MetaMapping();
      System.out.print("String_Node_Str");
      aMap=mp.getClassification(nodeValue);
      System.out.println("String_Node_Str");
      Element StubVal=doc.createElement(nodeName);
      lastY=0;
      for (int i=1; i < aMap.size(); i=i + 6) {
        Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
        int X=pos.getX();
        int Y=pos.getY();
        Element HeadPart=doc.createElement("String_Node_Str");
        if (X > lastY) {
          tn=doc.createTextNode(nodeValue.substring(lastY,X));
          StubVal.appendChild(tn);
        }
        lastY=X + Y;
        HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
        HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        if (nodeName.equals("String_Node_Str")) {
          MetaMapStats.AddStubMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        }
 else {
          MetaMapStats.AddSubHeaderMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        }
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
        HeadPart.setTextContent(nodeValue.substring(X,X + Y));
        StubVal.appendChild(HeadPart);
      }
      tn=doc.createTextNode(nodeValue.substring(lastY,nodeValue.length()));
      StubVal.appendChild(tn);
      Stube.appendChild(StubVal);
    }
    valueStr=value.item(0).getTextContent();
    valueStr=valueStr.replaceAll("String_Node_Str","String_Node_Str");
    Element Valuee=doc.createElement("String_Node_Str");
    Cell.appendChild(Valuee);
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(valueStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size() - 1; i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(valueStr.substring(lastY,X));
        Valuee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddValueMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(valueStr.substring(X,X + Y));
      Valuee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(valueStr.substring(lastY,valueStr.length()));
    Valuee.appendChild(tn);
    CellTypeStr=CellType.item(0).getTextContent();
    Element CellTypee=doc.createElement("String_Node_Str");
    Cell.appendChild(CellTypee);
    CellTypee.setTextContent(CellTypeStr);
    Element Table=doc.createElement("String_Node_Str");
    RootElement.appendChild(Table);
    Element TableTypee=doc.createElement("String_Node_Str");
    TableTypeStr=TableType.item(0).getTextContent();
    TableTypee.setTextContent(TableTypeStr);
    Table.appendChild(TableTypee);
    Element TableNamee=doc.createElement("String_Node_Str");
    Table.appendChild(TableNamee);
    TableNameStr=tableName.item(0).getTextContent();
    TableNameStr=TableNameStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(TableNameStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(TableNameStr.substring(lastY,X));
        TableNamee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddTableNameMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(TableNameStr.substring(X,X + Y));
      TableNamee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(TableNameStr.substring(lastY,TableNameStr.length()));
    TableNamee.appendChild(tn);
    Element TableOrdere=doc.createElement("String_Node_Str");
    TableOrderStr=tableOrder.item(0).getTextContent();
    TableOrdere.setTextContent(TableOrderStr);
    Table.appendChild(TableOrdere);
    Element TableFootere=doc.createElement("String_Node_Str");
    Table.appendChild(TableFootere);
    TableFooterStr=tableFooter.item(0).getTextContent();
    TableFooterStr=TableFooterStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(TableFooterStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(TableFooterStr.substring(lastY,X));
        TableFootere.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddTableFooterMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(TableFooterStr.substring(X,X + Y));
      TableFootere.appendChild(HeadPart);
    }
    tn=doc.createTextNode(TableFooterStr.substring(lastY,TableFooterStr.length()));
    TableFootere.appendChild(tn);
    Element Documente=doc.createElement("String_Node_Str");
    RootElement.appendChild(Documente);
    Element DocumentTitlee=doc.createElement("String_Node_Str");
    DocumentTitleStr=DocumentTitle.item(0).getTextContent();
    DocumentTitleStr=DocumentTitleStr.replaceAll("String_Node_Str","String_Node_Str");
    Documente.appendChild(DocumentTitlee);
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(DocumentTitleStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(DocumentTitleStr.substring(lastY,X));
        DocumentTitlee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddArticleNameMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(DocumentTitleStr.substring(X,X + Y));
      DocumentTitlee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(DocumentTitleStr.substring(lastY,DocumentTitleStr.length()));
    DocumentTitlee.appendChild(tn);
    Element PMCe=doc.createElement("String_Node_Str");
    Documente.appendChild(PMCe);
    PMCe.setTextContent(PMC.item(0).getTextContent());
    XMLDocumentTagged=doc;
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void MetamapTagDocument(){
  NodeList Head00=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList HeaderValue=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList Stub=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList value=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList CellType=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList TableType=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableName=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableOrder=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList tableFooter=XMLDocument.getElementsByTagName("String_Node_Str");
  NodeList DocumentTitle=XMLDocument.getElementsByTagName("String_Node_Str");
  try {
    NodeList PMC=XMLDocument.getElementsByTagName("String_Node_Str");
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    Document doc=docBuilder.newDocument();
    String Head00Str="String_Node_Str";
    String HeaderValueStr="String_Node_Str";
    String[] Subheaders;
    String StubValue="String_Node_Str";
    String valueStr="String_Node_Str";
    String CellTypeStr="String_Node_Str";
    String TableTypeStr="String_Node_Str";
    String TableNameStr="String_Node_Str";
    String TableOrderStr="String_Node_Str";
    String TableFooterStr="String_Node_Str";
    String DocumentTitleStr="String_Node_Str";
    String PMCStr="String_Node_Str";
    if (Head00 != null && Head00.item(0) != null) {
      Head00Str=Head00.item(0).getTextContent();
    }
    Head00Str=Head00Str.replaceAll("String_Node_Str","String_Node_Str");
    MetaMapping mp=new MetaMapping();
    System.out.print("String_Node_Str");
    Map<Object,Object> aMap=mp.getClassification(Head00Str);
    System.out.println("String_Node_Str");
    Element RootElement=doc.createElement("String_Node_Str");
    Element Cell=doc.createElement("String_Node_Str");
    RootElement.appendChild(Cell);
    Element NavigationPath=doc.createElement("String_Node_Str");
    Cell.appendChild(NavigationPath);
    doc.appendChild(RootElement);
    Element Head00e=doc.createElement("String_Node_Str");
    int lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      lastY=X + Y;
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        Text tn=doc.createTextNode(Head00Str.substring(lastY,X));
        Head00e.appendChild(tn);
      }
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddHead00MMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(Head00Str.substring(X,X + Y));
      Head00e.appendChild(HeadPart);
    }
    Text tn=doc.createTextNode(Head00Str.substring(lastY,Head00Str.length()));
    Head00e.appendChild(tn);
    NavigationPath.appendChild(Head00e);
    if (HeaderValue != null && HeaderValue.item(0) != null) {
      HeaderValueStr=HeaderValue.item(0).getTextContent();
    }
    HeaderValueStr=HeaderValueStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(HeaderValueStr);
    System.out.println("String_Node_Str");
    Element HeaderValuee=doc.createElement("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(HeaderValueStr.substring(lastY,X));
        HeaderValuee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddHeaderMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(HeaderValueStr.substring(X,X + Y));
      HeaderValuee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(HeaderValueStr.substring(lastY,HeaderValueStr.length()));
    HeaderValuee.appendChild(tn);
    NavigationPath.appendChild(HeaderValuee);
    Element Stube=doc.createElement("String_Node_Str");
    NavigationPath.appendChild(Stube);
    NodeList stubVals=Stub.item(0).getChildNodes();
    for (int j=0; j < stubVals.getLength(); j++) {
      String nodeName=stubVals.item(j).getNodeName();
      String nodeValue=stubVals.item(j).getTextContent();
      nodeValue=nodeValue.replaceAll("String_Node_Str","String_Node_Str");
      mp=new MetaMapping();
      System.out.print("String_Node_Str");
      aMap=mp.getClassification(nodeValue);
      System.out.println("String_Node_Str");
      Element StubVal=doc.createElement(nodeName);
      lastY=0;
      for (int i=1; i < aMap.size(); i=i + 6) {
        Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
        int X=pos.getX();
        int Y=pos.getY();
        Element HeadPart=doc.createElement("String_Node_Str");
        if (X > lastY) {
          tn=doc.createTextNode(nodeValue.substring(lastY,X));
          StubVal.appendChild(tn);
        }
        lastY=X + Y;
        HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
        HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        if (nodeName.equals("String_Node_Str")) {
          MetaMapStats.AddStubMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        }
 else {
          MetaMapStats.AddSubHeaderMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
        }
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
        HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
        HeadPart.setTextContent(nodeValue.substring(X,X + Y));
        StubVal.appendChild(HeadPart);
      }
      tn=doc.createTextNode(nodeValue.substring(lastY,nodeValue.length()));
      StubVal.appendChild(tn);
      Stube.appendChild(StubVal);
    }
    if (value != null && value.item(0) != null) {
      valueStr=value.item(0).getTextContent();
    }
    valueStr=valueStr.replaceAll("String_Node_Str","String_Node_Str");
    Element Valuee=doc.createElement("String_Node_Str");
    Cell.appendChild(Valuee);
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(valueStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size() - 1; i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(valueStr.substring(lastY,X));
        Valuee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddValueMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(valueStr.substring(X,X + Y));
      Valuee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(valueStr.substring(lastY,valueStr.length()));
    Valuee.appendChild(tn);
    CellTypeStr=CellType.item(0).getTextContent();
    Element CellTypee=doc.createElement("String_Node_Str");
    Cell.appendChild(CellTypee);
    CellTypee.setTextContent(CellTypeStr);
    Element Table=doc.createElement("String_Node_Str");
    RootElement.appendChild(Table);
    Element TableTypee=doc.createElement("String_Node_Str");
    TableTypeStr=TableType.item(0).getTextContent();
    TableTypee.setTextContent(TableTypeStr);
    Table.appendChild(TableTypee);
    Element TableNamee=doc.createElement("String_Node_Str");
    Table.appendChild(TableNamee);
    if (tableName != null && tableName.item(0) != null) {
      TableNameStr=tableName.item(0).getTextContent();
    }
    TableNameStr=TableNameStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(TableNameStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(TableNameStr.substring(lastY,X));
        TableNamee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddTableNameMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(TableNameStr.substring(X,X + Y));
      TableNamee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(TableNameStr.substring(lastY,TableNameStr.length()));
    TableNamee.appendChild(tn);
    Element TableOrdere=doc.createElement("String_Node_Str");
    if (tableOrder != null && tableOrder.item(0) != null) {
      TableOrderStr=tableOrder.item(0).getTextContent();
    }
    TableOrdere.setTextContent(TableOrderStr);
    Table.appendChild(TableOrdere);
    Element TableFootere=doc.createElement("String_Node_Str");
    Table.appendChild(TableFootere);
    if (tableFooter != null && tableFooter.item(0) != null) {
      TableFooterStr=tableFooter.item(0).getTextContent();
    }
    TableFooterStr=TableFooterStr.replaceAll("String_Node_Str","String_Node_Str");
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(TableFooterStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(TableFooterStr.substring(lastY,X));
        TableFootere.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddTableFooterMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(TableFooterStr.substring(X,X + Y));
      TableFootere.appendChild(HeadPart);
    }
    tn=doc.createTextNode(TableFooterStr.substring(lastY,TableFooterStr.length()));
    TableFootere.appendChild(tn);
    Element Documente=doc.createElement("String_Node_Str");
    RootElement.appendChild(Documente);
    Element DocumentTitlee=doc.createElement("String_Node_Str");
    if (DocumentTitle != null && DocumentTitle.item(0) != null) {
      DocumentTitleStr=DocumentTitle.item(0).getTextContent();
    }
    DocumentTitleStr=DocumentTitleStr.replaceAll("String_Node_Str","String_Node_Str");
    Documente.appendChild(DocumentTitlee);
    mp=new MetaMapping();
    System.out.print("String_Node_Str");
    aMap=mp.getClassification(DocumentTitleStr);
    System.out.println("String_Node_Str");
    lastY=0;
    for (int i=1; i < aMap.size(); i=i + 6) {
      Position pos=(Position)((ArrayList)aMap.get(i + 1)).get(0);
      int X=pos.getX();
      int Y=pos.getY();
      Element HeadPart=doc.createElement("String_Node_Str");
      if (X > lastY) {
        tn=doc.createTextNode(DocumentTitleStr.substring(lastY,X));
        DocumentTitlee.appendChild(tn);
      }
      lastY=X + Y;
      HeadPart.setAttribute("String_Node_Str",aMap.get(i - 1).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 2).toString());
      HeadPart.setAttribute("String_Node_Str",MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      MetaMapStats.AddArticleNameMMStats(MetaMapping.getNiceSemanticType(aMap.get(i + 2).toString()));
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setAttribute("String_Node_Str",aMap.get(i + 3).toString());
      HeadPart.setTextContent(DocumentTitleStr.substring(X,X + Y));
      DocumentTitlee.appendChild(HeadPart);
    }
    tn=doc.createTextNode(DocumentTitleStr.substring(lastY,DocumentTitleStr.length()));
    DocumentTitlee.appendChild(tn);
    Element PMCe=doc.createElement("String_Node_Str");
    Documente.appendChild(PMCe);
    PMCe.setTextContent(PMC.item(0).getTextContent());
    XMLDocumentTagged=doc;
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}