Free Support Forum -

Word document Mail Merge Template with XML data using Aspose.Words REST API issue

executeTemplate xml fields order matter
name: “template.docx”,
withRegions: false,
cleanup: null,
filename: “template.pdf”,
storage: null,
useWholeParagraphAsRegion: false,
file: Encoding.UTF8.GetBytes(GetXml()),
folder: null);
GetXml() returns data from _simple_sample.xml (20.4 KB)

If I change order of “first” and “second” elements I’ll get expected output
expected_output.pdf (15.7 KB)


I am looking into this issue and will guide you shortly.


This issue is not because of fields order in XML, it is because of the same field first appearing twice at different levels (one as an outer and second as an inner field). If you replace inner or outer first field with some other name like third, this issue would not appear.

This may be a bug, I have logged this issue (WORDSCLOUD-340) in our internal tracking software for further investigation by our Development Team. I will update you here once I have feedback from our Development Team.

Thanks for confirming and logging the issue.

I got that the issue because of name duplication. But I think the same names on different levels should be allowed in any order. Right now depending on order functionality works differently


We understand your concerns and we will definitely fix it.


I am pleased to inform you that your reported issue (WORDSCLOUD-340) has been fixed.