I want to replace a text by an image in a docx, my aproach is to find the text that I want to replace in the XML version and replace it by the XML code for a picture.
I've already done the first part, find the text thank's to xpath and JAXBNodes:
- Code: Select all
String xpath = "//w:r[w:t[contains(text(),'$logo$')]]";
List<Object> list = this.getDocumentPart().getJAXBNodesViaXPath(xpath, false);
But now I don't know what to do for replace that by a picture and his XML part ?