private void initFootnotes() throws XmlException, IOException {
for(POIXMLDocumentPart p : getRelations()){
String relation = p.getPackageRelationship().getRelationshipType();
if (relation.equals(XWPFRelation.FOOTNOTE.getRelation())) {
FootnotesDocument footnotesDocument = FootnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
this.footnotes = (XWPFFootnotes)p;
this.footnotes.onDocumentRead();
for(CTFtnEdn ctFtnEdn : footnotesDocument.getFootnotes().getFootnoteList()) {
footnotes.addFootnote(ctFtnEdn);
}
} else if (relation.equals(XWPFRelation.ENDNOTE.getRelation())){
EndnotesDocument endnotesDocument = EndnotesDocument.Factory.parse(p.getPackagePart().getInputStream());