MainDocumentPart getXML() is coming as null
Posted: Thu Apr 02, 2020 3:43 am
Hi,
documentPart.getXML() is coming as null for some of the docx files however when I open the file in word 2010 and save the same file I am getting values from the docx file.
Enclosed the docx file. Reqesting your kind advise how to handle the scenario when documentPart.getXML() gives null value.
Below is the code:
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(fileNameWithPath));
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
documentPart.getXML()
Attachment:
Appreciate your timely help to resolve this issue.
Regards,
Arul
documentPart.getXML() is coming as null for some of the docx files however when I open the file in word 2010 and save the same file I am getting values from the docx file.
Enclosed the docx file. Reqesting your kind advise how to handle the scenario when documentPart.getXML() gives null value.
Below is the code:
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(fileNameWithPath));
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
documentPart.getXML()
Attachment:
Appreciate your timely help to resolve this issue.
Regards,
Arul