We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to get the different Node values into one section of Aspose word Template

unable to access the node values from parent child in one section.pdf (44.5 KB)

I am trying to access different node values from the XML and fill it in the Aspose word template.
I have mentioned all the steps including the original Document, XML data, desired output and the procedure I tried to implement.

I am using {{forEach}} loop (You can refer at the end of Uploaded Document) in case if there are multiple letterOutMembers.

Anyone please let me know if there is any kind of solution.



Thanks for your inquiry. In case, you are using ‘Mustache’ template syntax, please refer to the following article:
Mail Merge using ‘Mustache’ Template Syntax

Moreover, we suggest you please read about our LINQ Reporting engine. LINQ Reporting Engine enables you to build reports in a similar way as Aspose.Words Mail Merge does. The engine provides the API that enables you to populate template documents with a data that comes from various sources.
Introduction to LINQ Reporting Engine
Template Syntax

The complete syntax of a foreach tag (including optional elements) is as follows.
<<foreach [variable_type variable_name in sequence_expression]>>


Thanks for your reply. I have tried using ‘Mustache’ and also foreach loop as you have mentioned. But actually I am trying to access the different element child values which are independent which you can see in PDF I have uploaded.
There are total 2 elements ‘letterOutHeader’ ‘letterOutMember’ which are independent under root element ‘letterOut’ in which the element ‘letterOutMember’ is repeatable as shown in sample uploaded PDF. I am trying access those different element values in one tabular section using foreachLoop.


Thanks for your inquiry. Please ZIP and attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.