Re: java.lang.NullPointerException when generating DOCX
Hussein Shafie <[email protected]> Mon, 9 Sep 2019 11:02:14 +0200
| Newsgroups | gmane.text.xml.xfc.general |
|---|---|
| Message-ID | <[email protected]> |
Tim B. wrote: > > I am experiencing issues with xslsrv with the attached files. Could I > ask for your assistance please. > > 1. The attached .fo file is being submitted to the following command: > > curl > "http://XXX:8080/xslsrv/exec?op=convert&mode=sync&conv=foToDocx&out=YYY.docx&url=file:/YYY.fo" > > However, the command simply returns blank. > > When I check the .fo file as follows, I get: > > fo2docx /YYY.fo test.docx > Cannot convert "/YYY.fo" to > "test.docx": java.lang.NullPointerException > > So I am finding it hard to work out and diagnose what it is in the .fo > file which is causing the conversion to fail. Can you advise how best to > work out the issue? It is caused by the two vertical-align="center" (invalid attribute value; see https://www.w3.org/TR/xsl/#vertical-align) found in your "YYY.fo". Replace these by (valid attribute value) vertical-align="middle" and you'll work around this bug. We'll fix this bug by making XMLmind XSL-FO Converter more robust in the next version (v6.2). > > 2. The same file is also passed to generate the file in PDF format: > using this: > > http://XXX:8080/xslsrv/exec?op=convert&mode=sync&conv=foToPDF&out=YYY.pdf&url=file:/YYY.fo > > The output pdf file generates fine. In fact, Apache FOP 2.3 reports many errors, among them: --- $ fop -r -fo YYYY.fo -pdf YYY.pdf [ERROR] FOUserAgent - Invalid property value encountered in vertical-align="center": org.apache.fop.fo.expr.PropertyException: file:/home/hussein/src/xfc/BUG1/YYY.fo:356:27: No conversion defined center; property:'vertical-align' (See position 358:112) ... --- (-r means: validity errors are not fatal.) -- XMLmind FO Converter Support List [email protected] https://www.xmlmind.com/mailman/listinfo/xfc-support