- Code: Select all
Object obj = XmlUtils.unmarshallFromTemplate(xml, mappings);
XmlUtils.marshaltoString(obj, true);
content.setJaxbElement((org.docx4j.wml.Document) obj);
… and that works really well. What I want to do now is map some of my tag types to HTML. I've been using sample code for loading in HTML as an altChunk and that works but I can't get it to swap with the tags.
From what I can tell from unmarshalling the altChunk object, we get a load of XML starting with
- Code: Select all
<w:altChunk r:id=.... />
I think the problem is that the code tries to insert the altChunk XML inside a w:t node, when it needs to actually replace the whole "parent" w:p node, but I'm a novice at this so could be wrong.
Any pointers gratefully received. I saw a post from last year about this from "vikrant" but they didn't appear to be having the same issue—duplicating his / her code just results in nothing being rendered at all for me:
docx-java-f6/can-i-insert-html-at-predefined-positions-in-my-template-t314.html#p945