I’m running into an issue with document generation for PDF documents. Users are using a native mobile app (Mx 8.4) and are (sometimes) adding emoji’s in input fields. This is not an issue for display in the App or in Excel exports. But PDF document generation raises an error: com.mendix.core.CoreException: com.mendix.modules.microflowengine.MicroflowException: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 273581; Character reference "�" is an invalid XML character. Does anyone know a workaround? E.g.: - Preventing using regex expression on input? - Removing using microflow/nanoflow action? - or something else?
The community commons has an XSSSanitize function. You should use that to filter out unwanted characters before you commit or clean them before generating the PDF by creating a temp object where you fill all the values used in the PDF.