Page 1 of 1

Replace a text by an image in XML

PostPosted: Thu May 11, 2017 7:01 pm
by ClementCvl
Hi,
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 ?

Re: Replace a text by an image in XML

PostPosted: Fri May 12, 2017 3:00 pm
by jason
I guess this is a duplicate of http://stackoverflow.com/questions/4391 ... ure-in-xml

Looks like you solved it...