I'm running docx4j 11.4.6 and 11.4.7 under Java 11, build all appears to get well, but when performing a really, really basic binding I constantly hit the following stack trace and XHTML data is not being bound:
- Code: Select all
18:01:59.588 [org.docx4j.samples.ContentControlsMergeXML281.main()] DEBUG org.docx4j.model.datastorage.BindingTraverserXSLT - Input XHTML: <div><p>lkjhkhjkhk</p>
</div>
18:01:59.589 [org.docx4j.samples.ContentControlsMergeXML281.main()] ERROR org.docx4j.model.datastorage.BindingTraverserXSLT - null
java.lang.NullPointerException: null
at java.base/java.lang.reflect.Method.invoke(Method.java:559)
at org.docx4j.model.datastorage.BindingTraverserXSLT.convertXHTML(BindingTraverserXSLT.java:885)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.docx4j.org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:343)
at org.docx4j.org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440)
at org.docx4j.org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:226)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:491)
at org.docx4j.org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
at org.docx4j.org.apache.xpath.XPath.execute(XPath.java:342)
at org.docx4j.org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:134)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.docx4j.org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:132)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2418)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2288)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1374)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:727)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1291)
at org.docx4j.org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1269)
at org.docx4j.XmlUtils.transform(XmlUtils.java:1516)
at org.docx4j.XmlUtils.transform(XmlUtils.java:1335)
at org.docx4j.model.datastorage.BindingTraverserXSLT.traverseToBind(BindingTraverserXSLT.java:209)
at org.docx4j.model.datastorage.BindingHandler.applyBindings(BindingHandler.java:292)
at org.docx4j.samples.ContentControlsMergeXML281.main(ContentControlsMergeXML281.java:138)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:279)
at java.base/java.lang.Thread.run(Thread.java:829)
I've tried here with just the demo for ContentControlsMergeXML281 and ContentControlsMergeXML. Unfortunately the hardcoded sample documents are missing so I've had to improvise, you can see the XHTML in the error, but the docx is invoice example (after failing with my own) cut down to a single XHTML field - truly minimal and not looking like a local office issue (was thinking my office 365 build might be the root). Same error for both examples.
Can you point me in the right direction or to any more documentation please?
This was:
docx4j-JAXB-MOXy if it makes a difference!