Page 1 of 1

How to obtain full XML

PostPosted: Fri Sep 04, 2015 9:10 am
by alosatriani
Hi, i'm creating a word document using doc4j with html altChunk and when i'm trying to get the XML:

wordMLPackage.getMainDocumentPart().getXML();

I get this simple xml output:

<w:document .....>
<w:body>
<w:altChunk r:id="rId2"/>
<w:sectPr>
<w:pgSz w:code="9" w:h="16839" w:w="11907"/>
<w:pgMar w:left="1440" w:bottom="1440" w:right="1440" w:top="1440"/>
</w:sectPr>
</w:body>
</w:document>

But before i was able to get the full XML containing the complete info inside my Word Document. Why is that? how i can get the full XML whit <w:p> <w:pr> <w:t> etc?

Re: How to obtain full XML

PostPosted: Fri Sep 04, 2015 1:16 pm
by jason
You need to invoke

Code: Select all
wordMLPackage.getMainDocumentPart().convertAltChunks()


first.

Be sure you have well formed XHTML, and docx4j-XHTMLImport jar on your classpath