I am replading a text with list of paragraphs, here is my code
- Code: Select all
WordprocessingMLPackage wordMLPackage =
WordprocessingMLPackage .load(new java.io.File("e://dev//java2word//word2java//ADL.docx"));
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
String xpath = "//w:r[w:t[contains(text(),'auditFindings')]]";
List<Object> list = documentPart.getJAXBNodesViaXPath(xpath, true);
for(Object obj : list){
List<Object> objContent=((R)obj).getContent();
objContent.clear();
objContent.add(getAuditFinding());
objContent.add(getFindingText());
}
wordMLPackage.save(new File("e://dev//java2word//word2java//ADL-new-2.docx"));
I open the ADL-new-2.docx it shows the new content , when I open in openoffice it does not show the new content also I created a pdf
WordprocessingMLPackage ...