Free Support Forum - aspose.cloud

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

executeTemplate xml fields order matter
_wordsApi.PostExecuteTemplate(
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
sample.zip (20.4 KB)

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

@darren_clark

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

@darren_clark

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.

@sohail.aspose
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

@darren_clark

We understand your concerns and we will definitely fix it.

@darren_clark

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