Document Templates: XML escape characters not handled properly
Hi all, In some app we use document templates within Mendix to generate Word/PDF files. If I add one of the known XML escape characters (https://stackoverflow.com/questions/730133/what-are-invalid-characters-in-xml) in the to be exported data, the functionality breaks. I would assume Mendix properly escapes those characters as part of the functionality itself? Is this a bug in the functionality or do I really need to filter out those escape characters with for instance a regex? Similar question asked by another user: https://forum.mendix.com/link/questions/100881 Regards, Ivo
Unfortunately yes, we have created some custom microflows to filter out the data before we generate the documents. It would indeed be nice if the platform could handle this.
When generating a Word Document, make sure to use the Java Action HTML to Plain text, the Document Generator interprets any string with HTML tags, and wont generate the document, also please check if there are any other charaters such as the ‘&’ that might also not be converted in the java Action, once you’ve done this, you will have a Word Document.