XHTML error

0
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta> <title>null</title> </head> <body>THIS IS THE FIRST COMMENT,<br /> <i>Changed date 05/06/2019 13:27 Changed by: garion.swann@mencap.org.uk</i><br /></body> </html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta> <title>null</title> </head> <body> THIS IS THE FIRST COMMENT,<br /> <i>Changed date 05/06/2019 13:27 Changed by: garion.swann@mencap.org.uk</i><br />THIS IS THE SECOND COMMENT,<br /> <i>Changed date 05/06/2019 13:30 Changed by: garion.swann@mencap.org.uk</i><br /> </body> </html> Here are two code snippets, they are used in a document template. For background: In an object I have a comment box, which when saved is cleared. The text that was in the copy box is added onto the end of an attribute called CommentAfterEventHistory.  In the document generation, it pulls an attribute that is created via this… it just takes CommentAfterEventHistory and adds it into an XHTML document, so it can be formatted when the user generates the document.   '<html>   <head>   <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>   <title>null</title>   </head>   <body>'  +$PlannedActivity/CommentAfterEventHistory+  '</body> </html>   If I generate the document after just one comment has been added it works perfectly (first code snippet), however when I add a second comment (second code snippet) it gives an error.  Full stacktrace is below but the main error is; Caused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 118; The element type "body" must be terminated by the matching end-tag "</body>". It’s complaining that there is no end tag for <body>, if you look at the code snippet the body tag is closed.  The other question is why does the document work with the first code snippet but not the second.  Stacktrace 14:30:14APPERRORConnector: com.mendix.core.CoreException: com.mendix.modules.microflowengine.MicroflowException: Error processing XHTML 14:30:14APPINFOat DailySupportRecord.ACT_GenerateEatingandDrinkingDocument (DocumentExport : 'Generate PDF (.pdf) document using template 'DOC_EatingandDrinking'') 14:30:14APPINFOAdvanced stacktrace: 14:30:14APPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:389) 14:30:14APPINFOCaused by: com.mendix.modules.microflowengine.MicroflowException: Error processing XHTML 14:30:14APPINFOat DailySupportRecord.ACT_GenerateEatingandDrinkingDocument (DocumentExport : 'Generate PDF (.pdf) document using template 'DOC_EatingandDrinking'') 14:30:14APPINFOAdvanced stacktrace: 14:30:14APPINFOat com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:146) 14:30:14APPINFOCaused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Error processing XHTML 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel$1.run(DynamicLabel.java:145) 14:30:14APPINFOCaused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 118; The element type "body" must be terminated by the matching end-tag "</body>". 14:30:14APPINFOat net.sf.saxon.event.Sender.sendSAXSource(Sender.java:469) 14:30:14APPINFOat net.sf.saxon.event.Sender.send(Sender.java:177) 14:30:14APPINFOat net.sf.saxon.Controller.makeSourceTree(Controller.java:1910) 14:30:14APPINFOat net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:573) 14:30:14APPINFOat net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:183) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel$1.run(DynamicLabel.java:142) 14:30:14APPINFOat java.security.AccessController.doPrivileged(Native Method) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel.parseHtml(DynamicLabel.java:111) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel.generateFO(DynamicLabel.java:78) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.Table.generateFO(Table.java:71) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.Dataview.generateFO(Dataview.java:34) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.generate(DocumentTemplateRepresentator.java:132) 14:30:14APPINFOat com.mendix.documentexporter.documents.FOBasedDocument.exportToInputStream(FOBasedDocument.java:81) 14:30:14APPINFOat com.mendix.documentexporter.DocumentGenerator.exportToInputStream(DocumentGenerator.java:111) 14:30:14APPINFOat com.mendix.documentexporter.DocumentGenerator.exportToIMendixObject(DocumentGenerator.java:78) 14:30:14APPINFOat com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:98) 14:30:14APPINFOat com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:18) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:201) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157) 14:30:14APPINFOat com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 14:30:14APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) 14:30:14APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) 14:30:14APPINFOat com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) 14:30:14APPINFOat com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) 14:30:14APPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:383) 14:30:14APPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:398) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.runMicroflow(ExecuteMicroflowAction.scala:46) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:32) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:15) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$4(RegularClientAction.scala:46) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.StateHandling.withState(StateHandling.scala:33) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.StateHandling.withState$(StateHandling.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.withState(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$3(RegularClientAction.scala:44) 14:30:14APPINFOat scala.util.Try$.apply(Try.scala:213) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2(RegularClientAction.scala:44) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2$adapted(RegularClientAction.scala:42) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.$anonfun$inContext$4(ContextHandling.scala:41) 14:30:14APPINFOat scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling$ClientMonitoredAction.monitor(ContextHandling.scala:49) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:41) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:27) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:24) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:19) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$1(RegularClientAction.scala:42) 14:30:14APPINFOat scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest(ProfileHandling.scala:14) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest$(ProfileHandling.scala:10) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.profileRequest(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.execute(RegularClientAction.scala:39) 14:30:14APPINFOat com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:124) 14:30:14APPINFOat com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:101) 14:30:14APPINFOat com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:40) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:72) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:69) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:75) 14:30:14APPINFOat com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:909) 14:30:14APPINFOat com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.service(RuntimeHandler.java:42) 14:30:14APPINFOat javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) 14:30:14APPINFOat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) 14:30:14APPINFOat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) 14:30:14APPINFOat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) 14:30:14APPINFOat org.eclipse.jetty.server.Server.handle(Server.java:502) 14:30:14APPINFOat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) 14:30:14APPINFOat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) 14:30:14APPINFOat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) 14:30:14APPINFOat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) 14:30:14APPINFOat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) 14:30:14APPINFOat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) 14:30:14APPINFOat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) 14:30:14APPINFOat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) 14:30:14APPINFOat java.lang.Thread.run(Thread.java:748) 14:30:14APPINFOCaused by: org.xml.sax.SAXParseException: The element type "body" must be terminated by the matching end-tag "</body>". 14:30:14APPINFOat org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 14:30:14APPINFOat org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) 14:30:14APPINFOat org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) 14:30:14APPINFOat org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 14:30:14APPINFOat org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) 14:30:14APPINFOat org.apache.xerces.parsers.XMLParser.parse(Unknown Source) 14:30:14APPINFOat org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) 14:30:14APPINFOat org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) 14:30:14APPINFOat net.sf.saxon.event.Sender.sendSAXSource(Sender.java:449) 14:30:14APPINFOat net.sf.saxon.event.Sender.send(Sender.java:177) 14:30:14APPINFOat net.sf.saxon.Controller.makeSourceTree(Controller.java:1910) 14:30:14APPINFOat net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:573) 14:30:14APPINFOat net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:183) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel$1.run(DynamicLabel.java:142) 14:30:14APPINFOat java.security.AccessController.doPrivileged(Native Method) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel.parseHtml(DynamicLabel.java:111) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DynamicLabel.generateFO(DynamicLabel.java:78) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.Table.generateFO(Table.java:71) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.Dataview.generateFO(Dataview.java:34) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.render(DocumentTemplateRepresentator.java:328) 14:30:14APPINFOat com.mendix.documentexporter.focomponents.DocumentTemplateRepresentator.generate(DocumentTemplateRepresentator.java:132) 14:30:14APPINFOat com.mendix.documentexporter.documents.FOBasedDocument.exportToInputStream(FOBasedDocument.java:81) 14:30:14APPINFOat com.mendix.documentexporter.DocumentGenerator.exportToInputStream(DocumentGenerator.java:111) 14:30:14APPINFOat com.mendix.documentexporter.DocumentGenerator.exportToIMendixObject(DocumentGenerator.java:78) 14:30:14APPINFOat com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:98) 14:30:14APPINFOat com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:18) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:201) 14:30:14APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157) 14:30:14APPINFOat com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 14:30:14APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) 14:30:14APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) 14:30:14APPINFOat com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) 14:30:14APPINFOat com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) 14:30:14APPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:383) 14:30:14APPINFOat com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:398) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.runMicroflow(ExecuteMicroflowAction.scala:46) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:32) 14:30:14APPINFOat com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:15) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$4(RegularClientAction.scala:46) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.StateHandling.withState(StateHandling.scala:33) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.StateHandling.withState$(StateHandling.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.withState(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$3(RegularClientAction.scala:44) 14:30:14APPINFOat scala.util.Try$.apply(Try.scala:213) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2(RegularClientAction.scala:44) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2$adapted(RegularClientAction.scala:42) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.$anonfun$inContext$4(ContextHandling.scala:41) 14:30:14APPINFOat scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49) 14:30:14APPINFOat com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling$ClientMonitoredAction.monitor(ContextHandling.scala:49) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:41) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:27) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:24) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:19) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$1(RegularClientAction.scala:42) 14:30:14APPINFOat scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest(ProfileHandling.scala:14) 14:30:14APPINFOat com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest$(ProfileHandling.scala:10) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.profileRequest(RegularClientAction.scala:21) 14:30:14APPINFOat com.mendix.webui.actions.client.RegularClientAction.execute(RegularClientAction.scala:39) 14:30:14APPINFOat com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:124) 14:30:14APPINFOat com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:101) 14:30:14APPINFOat com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:40) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:72) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:69) 14:30:14APPINFOat com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) 14:30:14APPINFOat com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:75) 14:30:14APPINFOat com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:909) 14:30:14APPINFOat com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.service(RuntimeHandler.java:42) 14:30:14APPINFOat javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) 14:30:14APPINFOat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) 14:30:14APPINFOat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) 14:30:14APPINFOat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) 14:30:14APPINFOat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) 14:30:14APPINFOat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) 14:30:14APPINFOat org.eclipse.jetty.server.Server.handle(Server.java:502) 14:30:14APPINFOat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) 14:30:14APPINFOat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) 14:30:14APPINFOat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) 14:30:14APPINFOat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) 14:30:14APPINFOat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) 14:30:14APPINFOat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) 14:30:14APPINFOat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) 14:30:14APPINFOat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) 14:30:14APPINFOat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) 14:30:14APPINFOat java.lang.Thread.run(Thread.java:748)
asked
1 answers
2

Hi Garion,

I’m not too sure why you are running into that issue. I created a document in a test project an it worked fine, so not sure why I can’t reproduce your error. 

I’ve done similar functionality before and I remember running into some issues with my html if it wasn’t formatted correctly. I ended up creating a java action that took my html string and used the jsoup library to format it correctly.

Here is the java action if you want to give it a try

https://drive.google.com/file/d/1Wu70QwtOWhlummoIIEPAC1oNPuKvQRDF/view?usp=sharing

and the jar file for it. Its jsoup version 1.11.2

https://drive.google.com/file/d/1fVUoE5kVOALgzbvNXP9tro4ScqLBGcND/view?usp=sharing

 

Hope this helps!

 

Edit: Java action code

org.jsoup.nodes.Document document = Jsoup.parse(HTML);
document.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml); 
return document.toString();

 

answered