sourceNode.getLocalName()
WordprocessingMLPackage wordMLPackage = Docx4J.load(template);
Docx4J.bind(wordMLPackage, xml, Docx4J.FLAG_BIND_INSERT_XML & Docx4J.FLAG_BIND_BIND_XML);
Docx4J.save(wordMLPackage, out, Docx4J.FLAG_NONE);
documentBuilderFactory.setNamespaceAware(true);
brunoop wrote:Could you please post an example of a working XML so I can try to debug the problem?
Caused by: javax.xml.bind.UnmarshalException: unexpected element (URI:"http://schemas.openxmlformats.org/wordprocessingml/2006/main", local:"tc"). The expected elements are <{http://schemas.openxmlformats.org/wordprocessingml/2006/main}sdt>,
https://github.com/plutext/docx4j/blob/ ... geXML.java is a working example. You'll notice the XML in this example, at sample-docs/word/databinding/binding-simple-data.xml does not use namespaces.
mvn install:install-file -Dfile=/home/dev/nightly/docx4j-3.3.1-nightly-20160605.jar
brunoop wrote:Are you sure that is a working example in 3.3.1?
INFO org.docx4j.jaxb.Context .<clinit> line 85 - java.vendor=Sun Microsystems Inc.
INFO org.docx4j.jaxb.Context .<clinit> line 86 - java.version=1.6.0_27
:
INFO org.docx4j.XmlUtils .<clinit> line 192 - Using com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
INFO org.docx4j.XmlUtils .<clinit> line 239 - Using com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
INFO org.docx4j.jaxb.Context - java.vendor=Oracle Corporation
INFO org.docx4j.jaxb.Context - java.version=1.8.0_91
INFO org.docx4j.jaxb.Context - No MOXy JAXB config found; assume not intended..
WARN org.docx4j.jaxb.NamespacePrefixMapperUtils - name: com.sun.xml.internal.bind.namespacePrefixMapper value: org.docx4j.jaxb.NamespacePrefixMapperSunInternal@73989866 .. trying RI.
INFO org.docx4j.jaxb.NamespacePrefixMapperUtils - Using NamespacePrefixMapper, which is suitable for the JAXB RI
INFO org.docx4j.jaxb.Context - Using JAXB Reference Implementation
INFO org.docx4j.jaxb.Context - Not using MOXy; using com.sun.xml.bind.v2.runtime.JAXBContextImpl
WARN org.docx4j.utils.ResourceUtils - Couldn't get resource: docx4j.properties
WARN org.docx4j.Docx4jProperties - Couldn't find/read docx4j.properties; docx4j.properties not found via classloader.
INFO org.docx4j.XmlUtils - Using com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
INFO org.docx4j.XmlUtils - Using com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
INFO org.docx4j.openpackaging.contenttype.ContentTypeManager - Detected WordProcessingML package
INFO org.docx4j.openpackaging.io3.Load3 - Instantiated package of type org.docx4j.openpackaging.packages.WordprocessingMLPackage
INFO org.docx4j.utils.XPathFactoryUtil - xpath implementation: __redirected.__XPathFactory
WARN org.docx4j.openpackaging.io3.Load3 - No JAXB model for this CustomXmlDataStorage part; null
INFO org.docx4j.openpackaging.io3.Load3 - package read; elapsed time: 3362 ms
INFO org.docx4j.model.datastorage.OpenDoPEHandler - OpenDoPE XPaths part missing (ok if you are just processing w15 repeatinSection)
WARN org.docx4j.model.datastorage.BindingHandler - OpenDoPE XPaths part missing
INFO org.docx4j.model.datastorage.BindingHandler - Using BindingTraverserXSLT, which is slower, but fully featured
org.docx4j.model.datastorage.OpenDoPEHandler (createNewXPathObject:1630) - New xpath entry overwrites existing xpath mCWoX_0
org.docx4j.model.datastorage.OpenDoPEHandler (createNewXPathObject:1630) - New xpath entry overwrites existing xpath mCWoX_1
java.lang.NullPointerException
at org.docx4j.model.datastorage.OpenDoPEHandler.processOpenDopeRepeat(OpenDoPEHandler.java:1012)
at org.docx4j.model.datastorage.OpenDoPEHandler.processBindingRoleIfAny(OpenDoPEHandler.java:821)
at org.docx4j.model.datastorage.OpenDoPEHandler.access$100(OpenDoPEHandler.java:80)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.apply(OpenDoPEHandler.java:667)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.walkJAXBElements(OpenDoPEHandler.java:713)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.walkJAXBElements(OpenDoPEHandler.java:729)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.walkJAXBElements(OpenDoPEHandler.java:729)
at org.docx4j.TraversalUtil.<init>(TraversalUtil.java:214)
at org.docx4j.model.datastorage.OpenDoPEHandler.preprocess(OpenDoPEHandler.java:276)
klausT wrote:This doesn't not happen when using the nightly build from 2016/10/30
Users browsing this forum: Bing [Bot] and 147 guests