; Line#: 69; Column#: 29
Using docx4j 2.7.1, October 14, 2011, downloaded jar file.
Test file with a table with a repeating row that contains two control fields (attached).
applyBinding works both with build 1620 and the above jar file, properly populating the target file, Word opens it fine, all looks good.
However, the above exception appears multiple times in the eclipse log file as a result of the call to applyBinding when using the above jar file.
Checked the source for build 1698, and the argument pattern in the exception, as noted, does not appear in BindingHandler.xpathGenerateRuns.
Test file attached. Passed this string as the new XML:
- Code: Select all
<yourxml><row><fielda>fieldx</fielda><fieldb>fieldy</fieldb></row><row><fielda>fieldr</fielda><fieldb>fields</fieldb></row></yourxml>
Code (error handling omitted):
- Code: Select all
OpenDoPEHandler odh = new OpenDoPEHandler(wordMLPackage);
odh.preprocess();
OpenDoPEIntegrity odi = new OpenDoPEIntegrity();
odi.process(wordMLPackage);
BindingHandler.applyBindings(wordMLPackage);
wordMLPackage.save(new File(sTemplatePath));
Suggestions? Full exception message below:
javax.xml.transform.TransformerException: java.lang.NoSuchMethodException: For extension function, could not find method static org.docx4j.model.datastorage.BindingHandler.xpathGenerateRuns([ExpressionContext,] #UNKNOWN (org.docx4j.openpackaging.packages.WordprocessingMLPackage), #UNKNOWN (java.util.HashMap), #STRING, #STRING, #STRING, #NODESET, #BOOLEAN).
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:422)
at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:440)
at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:222)
at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:473)
at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:208)
at org.apache.xpath.XPath.execute(XPath.java:337)
at org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:134)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:128)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:116)
at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:132)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2270)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1356)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1273)
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251)
at org.docx4j.XmlUtils.transform(XmlUtils.java:830)
at org.docx4j.XmlUtils.transform(XmlUtils.java:723)
at org.docx4j.model.datastorage.BindingHandler.applyBindings(BindingHandler.java:176)
at org.docx4j.model.datastorage.BindingHandler.applyBindings(BindingHandler.java:125)