Not merging whole node if any of child node is not present

Dear Aspose,
I am licensed user of Aspose.
I am using Aspose version 11.0.0
I have an xml in following format and template document. When i merge this xml with attached template then data for WellBorePropertiesFirst and WellBorePropertiesSecond display properly.
Issue is that in case if there any of child node WellBorePropertiesFirst and WellBorePropertiesSecond is not present in xml then in after merging in final document data of both node not appaer. So if any child node is not present then both node doesn’t display avalable data in xml.
Please let me know how can i print the data in final document after merging even if any data available for any child node. Both should not disappear if any child node is not present.
sample xml file and template is attached for reference.
thanks
arvind

<Job>
  <JobName>Job_TestDev14MarBC1</JobName>
  <WellDetails>
    <WellBore>
      <WellboreProperties>
        <WellBorePropertiesFirst>
          <PrRow>
            <ColumnFirst>TopMD</ColumnFirst>
            <ColumnSecond>22 ft</ColumnSecond>
          </PrRow>
          <PrRow>
            <ColumnFirst>TopTVD</ColumnFirst>
            <ColumnSecond>33ft</ColumnSecond>
          </PrRow>
          <PrRow>
            <ColumnFirst>H2SPresent</ColumnFirst>
            <ColumnSecond>U</ColumnSecond>
          </PrRow>
          <PrRow>
            <ColumnFirst>CO2Present</ColumnFirst>
            <ColumnSecond>U</ColumnSecond>
          </PrRow>
        </WellBorePropertiesFirst>
        <WellBorePropertiesSecond>
          <PrRow>
            <ColumnFirst>BottomMD</ColumnFirst>
            <ColumnSecond>32 ft</ColumnSecond>
          </PrRow>
          <PrRow>
            <ColumnFirst>BottomTVD</ColumnFirst>
            <ColumnSecond>33 ft</ColumnSecond>
          </PrRow>
        </WellBorePropertiesSecond>      
      </WellboreProperties>      
    </WellBore>
  </WellDetails>
</Job>

Hi Arvind,

Thanks for your inquiry. I have tested the scenario with following code snippet and have not found any issue with output file. I have removed the child nodes of WellBorePropertiesFirst and WellBorePropertiesSecond and have tested the shared issue, the output files look good. I have attached the output files with this post for your kind reference. It would be great if you please share following details for investigation purposes.

What environment are you running on?

  • OS (Windows Version or Linux Version)
  • Architecture (32 / 64 bit)
  • .NET Framework version
  • Please supply us with the code from your application that is causing the issue
  • Please supply us with the output document showing the undesired behavior
  • Please supply us with the expected document showing the desired behavior (You can create this document using Microsoft Word).

As soon as you get these pieces of information to us we’ll start our investigation into your issue.

Document doc = new Document(MyDir + "Proposal.docx");

DataSet ds = new DataSet();
ds.ReadXml(MyDir + "wellbore.xml");
doc.MailMerge.ExecuteWithRegions(ds);
doc.Save(MyDir + "AsposeOut.docx");