Free Support Forum - aspose.cloud

Mail Merge Word Template API of Aspose.Words Cloud is broken

We are using mergeTemplate API for words. (Aspose.Words for Cloud)
Since today morning we see that the merged output is wrong. The values inserted into different sections are taken from a wrong xml element sent to API as input. We suspect there is a change in server side on your side and the name of the tags are being used wrongly without considering the parent element of the xml node to be used for replacing in the template.
We are attaching the template, the input xml and generated out.

Hi,

Sorry for the delay. This issue is in progress and will be resolved soon. We will update you as soon as it is resolved.

Best Regards,

Hi,

This looks to be the issue with your XML. If you try to open this XML in browser, you will see the errors. XML is corrupt and cannot be used to execute template. I was able to execute this template after simplifying the XML.

Can you please share your expected output document? We will modify your template and XML accordingly to produce your desired output.

Best Regards,

The issue was fixed without any change in the XML on our end. We had contacted Aspose team via Support. So I assume the issue has nothing to do with XML structure or validity as such. Moreover the same XML was working in past with Aspose API.

However if you have studied the structure and found any issues with our XML, kindly let us know what exactly you simplified or any specific issues that you see with the XML.

Most importantly if the issue is with XML format/validity, we would expect an error code returned back as API response and not a jumbled merged output. But if you see the old behavior where we received a jumbled response, the XML was read by Aspose server and there was merge in action but at wrong sections or wrong values carried over from wrong elements.

Can you please let us know what exactly was done to “fix” the issue on Aspose side? It is working as of now without any change on our side.

Hi,

Not sure if you have changed anything but your XML is still throwing the same error at my end as it was throwing before. The error message from Aspose for Cloud is 'Data at the root level is invalid. Line 133, position 1.' and the reason is you have declared XML twice.

I have updated the XML and removed duplicate XML declaration as you can see in the attached XML. It started working after removing the duplicate declaration.

Best Regards,

Sorry, I got the point now. THe XML that we attached in the ticket was extracted from the logs that we generated from test code. It had duplicate xml declaration as you found. I have attached the xml which is sent to cloud from the production application. It should match with what you have after cleanup.

Hope this works now and also assume that with this, xml structure may not really be an issue with the problem we faced in the first place.

We would like to know what caused the problem in first place and how can we avoid such incidents going forward. We are still not sure of what fixed the issue without any change on our side. So we assume there was a bug fixed on your side. It would be nice if we can have a reference to the BUG id.

Hi,

New release was published during that period and Aspose.Words related changes were rolled back to changes were rolled back to resolve your issue. We are gathering more detail on this as all tests were passing after the release.

We will share complete details and issue ID with you soon.

Best Regards,

Hi,

We had upgraded our codebase from version 14.10.0 to 14.11.0 and your XML was broken after that. After this change was rolled back, your XML started working again. We will upgrade the codebase after appropriate testing to make sure your XML does not break again.

Sorry for the inconvenience.

Best Regards,

It has broken again since yesterday. HAve you pushed a new build on your side?
The issue is exact same as above.

Hi,

In fact your XML is not consistent with the template. We are working on your XML and update it according to template and share with you. If we roll the changes back, it will fix the issue for the moment but it will appear again with the future changes. So permanent solution is to update template or XML accordingly.

Best Regards,

Hi,

Your template and XML have been updated. Your XML had two resume tags but I have modified the first one only. You can update the second one accordingly. Please check attached updated template and XML. Please note the following changes/instructions to build a good working template.

  • Names of duplicate field names like Value, Description, StartDate and EndDate have been updated to make the names unique. You should follow the same approach.
  • foreach block was missing from Technical skills heading. It has been added now.
  • There is one foreach block in the header of the document i.e. foreach resume. When passing XML values for this block, send the values only once. In your case Phone, Email and Address fields are present in the header. You will send matching XML tags in the first resume tag only. Remove these tags from and subsequent resume tags of the XML. If you will include these tags in all resume tags, you will see your header repeating in the output document.

Please test at your end and let us know if you see any issue. Please also share your expected output if you still want any improvement.

Best Regards,

I think you are referring to a wrong xml as reference.
In fact I had also replied couple of times with actual XML that we are using - the first one had two resume tags by mistake in collecting from logs.
So points related to duplicate resume tag are not really applicable for this issue.
The next point regarding foreach loop missing - we dont really any loop there since the skills are a single value (though it has comma separated strings) we want to use it as a single string and not have a loop. So we expect it to work without a loop.

The most concerning thing is regarding uniqueness of tag names in XML- we believed that any xml element name needs to be unique only within its parent. eg value tag within technicalskills tag and value tag within skills tag are not same and should not create a problem.
Are you saying that all tag names irrespective of whatever nesting level, must be unique across whole XML?

We tried with your xml and template in a test program.
It generates an output with multiple sections without any data.
We have added following parameters in the API url as per your documentation to remove empty sections from generated merge output.
/executeTemplate?cleanup=EmptyParagraphs,UnusedRegions,UnusedFields,ContainingFields

However this filtering does not work and all the sections in the template are seen in merged output.
See attached document with merge output and empty sections towards the end of document.

This was not happening originally and we could successfully hide the empty sections.
This issue is not related with any name clashes either.
Anything we are missing here? How can we remove the empty sections or conditionally add?

Hi,

As far as unique names are concerned, yes same names under different sections/XML tags should be considered as unique and names should be unique under same parent only. At the moment, it is not working as expected and we are trying to fix it as soon as possible.

Regarding your query related to removing empty regions, we are working on it and will share a working solution soon. Sorry for the inconvenience.

Best Regards,

Hi,

If you pass the values for all fields, then there will be no issue of unique names and values will be set appropriately but in your case you have used same field names under different parents and are setting values for few of them, and that is the reason remaining fields with the same name take their value from the previous field with that name. This issue has been logged into our issue tracking system as SAASWORDS-172. We will update you as soon as it is resolved.

As far as removing unused regions is concerned, you need to send empty tags for empty regions in the XML as you can see in the following XML.

<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

Best Regards,

Thanks. Is there a way for us to know a timeline of when can we expect this ticket to be fixed?
Also the suggestion for unused region, we are alrady doing the same - ie not sending the tags when we want to section to be dropped. This was working as usual earlier. I assume this will also be taken care in the ticket created on your side

Hi,

Remove unused regions if no XML tags are passed is not the part of previously logged issue. It has been logged as SAASWORDS-201. Priority of both issues has been raised and we will share the ETA as soon as our development team completes the analysis.

Best Regards,

Hi,

Both issues have been resolved on staging. These changes will be pushed to live next week and then you will be able to use. We will update you as soon as these changes are live.

Best Regards,

Two weeks have passed now. Have not heard any news from your team. This is absolutely unacceptable support level. You guys do not even have sensitivity of informing of delay on ETAs promised. Highly disappointing.

Hi,

There are several changes including these fixes in the present release. We are thoroughly testing the changes before moving them to live to make sure nothing is broken after the changes are published. Testing took a little longer than the expected because of some issues.

We will push the changes to live as soon as possible (hopefully today) and let you know once done.

We are extremely sorry for the inconvenience.

Best Regards,