Problems Merge XML

Hi, after buildReport, the document is not generated correctly. Specifically

<<[ordinanzaRateizzazione.destinatario.indirizzo.completo]>> is not replaced correctly.

void tryMerge() throws Exception {

    String fileName = "C:\\Samuele\\esporta-archivi-source-template\\converted\\Comunicazione_ordinanza_rateizzazione.odt";
// Load the template document.
    Document doc = new Document(fileName);


    DataSet x =new DataSet("ds");

    x.readXml(
          "C:\\Samuele\\java\\concilia-rtf-converter\\src\\main\\resources\\example.xml");
    print_values(x,"test");

// Create a Reporting Engine.
    ReportingEngine engine = new ReportingEngine();
    engine.getKnownTypes().add(Util.class);
    ReportingEngine.setUseReflectionOptimization(false);
    doc.getMailMerge().setUseNonMergeFields(true);
  engine.setOptions(ReportBuildOptions.INLINE_ERROR_MESSAGES + ReportBuildOptions.ALLOW_MISSING_MEMBERS + ReportBuildOptions.REMOVE_EMPTY_PARAGRAPHS);
// Execute the build report.
    engine.buildReport(doc, x, "ds");


// Save the finished document to disk.
    doc.save("c:\\tmp\\Test_Aspose.odt");
  }

  private static void print_values(DataSet dataSet, String label) {
    System.out.println("\n" + label);
    for (DataTable table : dataSet.getTables()) {
      System.out.print(table.getTableName() + ":\nChildTables: ");
      for (DataRelation dr : table.getChildRelations()) {
        System.out.print(dr.getChildTable().getTableName() + " ");
      }
      System.out.print("\nColumns: ");
      for (DataColumn column : table.getColumns()) {
        System.out.print(column.getColumnName() + " | ");
      }
      int row_num = 0;
      for (DataRow row : table.getRows()) {
        System.out.print("\nRow " + row_num + ": ");
        for (DataColumn column : table.getColumns()) {
          System.out.print(row.get(column) + " | ");
        }
      }
      System.out.println("\n");
    }
    }

Can you help me ?
Comunicazione_ordinanza_rateizzazione.zip (19.9 KB)

@samuele.lucarini We will check the issue and get back to you soon.

@samuele.lucarini There are destinatario element on different levels in you XML and this causes the problem. Please try using the following modified XML:
example_modified.zip (1.1 KB)

So I can’t have complex elements with the same name… is that correct?

@samuele.lucarini XML is read into DataSet. DataSet cannot have several tables with the same name. So, you cannot have complex elements with the same name in XML.