Zen Reports error
Hi,
I'm having the following error visualizing a PDF report.
An invalid XML character (Unicode: 0x3) was found in the value of attribute "Reaction" and element is "Allergies".
Aug 18, 2017 10:50:29 AM org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-height set to: 11in
Aug 18, 2017 10:50:29 AM org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-width set to: 8.26in
Aug 18, 2017 10:50:30 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
org.apache.fop.apps.FOPException: org.xml.sax.SAXParseException; systemId: file:/D:/SOJHSSDTC/mgr/Temp/Vte547p7Yyihkg.xml; lineNumber: 5; columnNumber: 47; An invalid XML character (Unicode: 0x3) was found in the value of attribute "Reaction" and element is "Allergies".
net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; systemId: file:/D:/SOJHSSDTC/mgr/Temp/Vte547p7Yyihkg.xml; lineNumber: 5; columnNumber: 47; An invalid XML character (Unicode: 0x3) was found in the value of attribute "Reaction" and element is "Allergies".
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:303)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; systemId: file:/D:/SOJHSSDTC/mgr/Temp/Vte547p7Yyihkg.xml; lineNumber: 5; columnNumber: 47; An invalid XML character (Unicode: 0x3) was found in the value of attribute "Reaction" and element is "Allergies".
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:417)
at net.sf.saxon.event.Sender.send(Sender.java:156)
at net.sf.saxon.Controller.transform(Controller.java:1691)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:300)
... 3 more
Caused by: org.xml.sax.SAXParseException; systemId: file:/D:/SOJHSSDTC/mgr/Temp/Vte547p7Yyihkg.xml; lineNumber: 5; columnNumber: 47; An invalid XML character (Unicode: 0x3) was found in the value of attribute "Reaction" and element is "Allergies".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:397)
... 6 more
Comments
HI Rui
Unicode 0x3 is the ETX character, which can be used as newline in certain text editors. Any control chars are disallowed in XML processing, so these should be stripped from whatever query you are using to drive this report
HTH
Chris
Hi Chris,
Thanks for your help.
I've sorted the issue using $ZSTRIP function on the ReportDefinition.
<attribute name="Reaction" field="Reaction" expression='$ZSTRIP(%val,"*C")' />
Regards,
Rui
Reposting as an answer to get this removed from the "Unanswered questions" list
HI Rui
Unicode 0x3 is the ETX character, which can be used as newline in certain text editors. Any control chars are disallowed in XML processing, so these should be stripped from whatever query you are using to drive this report
HTH
Chris