- Code: Select all
public void replaceTitle(String headerString) throws JAXBException{
String xpath = "//w:r[w:t[contains(text(),'#Dokumentname')]]";
List<Object> list = mainDocumentPart.getJAXBNodesViaXPath(xpath, true);
for (Object obj : list) {
List<Object> objContent=((R)obj).getContent();
objContent.clear();
WordParagraph p = new WordParagraph(headerString);
objContent.add(p.getP());
}
}
How could I use this
- Code: Select all
String xpath = "//w:r[w:t[contains(text(),'audith')]]";
List<Object> list = documentPart.getJAXBNodesViaXPath(xpath, true);
to find a String "#Dokumentname" in my Header? Cause I'm not shure how to change the search string xpath above.