I am attempting to inject custom XML into an existing Word 2010 document. I have followed the example of http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/samples/CreateDocxWithCustomXml.java (except that I starting with an existing document).
However what I end up with is a blank document. The resulting file is several orders of magnitude smaller that the starting template. Poring over the logs I noted numerous warnings of the form
- Code: Select all
WARN handleEvent(JaxbValidationEventHandler.java:44) [ERROR] : unexpected element (uri:"http://schemas.openxmlformats.org/wordprocessingml/2006/main", local:"docDefaults")
I don't know much about the internals of Word and therefore am unable to interpret the meaning of the error/warning.
Can you help?