- Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:case xmlns:ns2="http://gctrack.gao.gov/templates/case-data">
<documentId>118905</documentId>
<fileNumber>408694</fileNumber>
<caseNumber>9</caseNumber>
this is the snippet of code
- Code: Select all
// xmlDocument is created by JAXB marshalling of my data class to Document
//created using docx4j org.docx4j.XmlUtils#neww3cDomDocument
wordMLPackage = Docx4J.load(new File(targetPath, "case-data-elements-inventory.docx"));
Docx4J.bind(wordMLPackage, xmlDocument, Docx4J.FLAG_BIND_INSERT_XML +
Docx4J.FLAG_BIND_BIND_XML + Docx4J.FLAG_BIND_REMOVE_SDT);
Here is the exception in 3.3.2 which I did not have in 3.3.0
- Code: Select all
Exception in thread "main" org.docx4j.openpackaging.exceptions.Docx4JException: Problems applying bindings
at org.docx4j.model.datastorage.BindingTraverserXSLT.traverseToBind(BindingTraverserXSLT.java:188)
at org.docx4j.model.datastorage.BindingHandler.applyBindings(BindingHandler.java:259)
at org.docx4j.model.datastorage.BindingHandler.applyBindings(BindingHandler.java:189)
at org.docx4j.Docx4J.bind(Docx4J.java:433)
at peacetech.gao.ogc.gctrack.test.TestAddCustomXmlPart.main(TestAddCustomXmlPart.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:143)
Caused by: java.lang.IllegalArgumentException: Unexpected localName ns2:case
at org.docx4j.model.datastorage.xpathtracker.Histgram.update(Histgram.java:29)
at org.docx4j.model.datastorage.DomToXPathMap.walkTree(DomToXPathMap.java:67)
at org.docx4j.model.datastorage.DomToXPathMap.walkTree(DomToXPathMap.java:61)
at org.docx4j.model.datastorage.DomToXPathMap.map(DomToXPathMap.java:35)
at org.docx4j.model.datastorage.BindingTraverserXSLT.traverseToBind(BindingTraverserXSLT.java:162)
... 9 more