/** * Read document */ internal override void OnDocumentRead() { FootnotesDocument notesDoc; Stream is1 = null; try { is1 = GetPackagePart().GetInputStream(); XmlDocument xmldoc = ConvertStreamToXml(is1); notesDoc = FootnotesDocument.Parse(xmldoc, NamespaceManager); ctFootnotes = notesDoc.Footnotes; } catch (XmlException) { throw new POIXMLException(); } finally { if (is1 != null) { is1.Close(); } } //get any Footnote if (ctFootnotes.footnote != null) { foreach (CT_FtnEdn note in ctFootnotes.footnote) { listFootnote.Add(new XWPFFootnote(note, this)); } } }
internal override void OnDocumentRead() { try { this.ctFootnotes = FootnotesDocument.Parse(this.GetPackagePart().GetInputStream()).Footnotes; } catch (XmlException ex) { throw new POIXMLException(); } foreach (CT_FtnEdn footnote in this.ctFootnotes.FootnoteList) { this.listFootnote.Add(new XWPFFootnote(footnote, this)); } }
/** * Read document */ internal override void OnDocumentRead() { FootnotesDocument notesDoc; try { Stream is1 = GetPackagePart().GetInputStream(); notesDoc = FootnotesDocument.Parse(is1); ctFootnotes = notesDoc.Footnotes; } catch (XmlException) { throw new POIXMLException(); } //get any Footnote foreach (CT_FtnEdn note in ctFootnotes.FootnoteList) { listFootnote.Add(new XWPFFootnote(note, this)); } }
private void InitFootnotes() { foreach (POIXMLDocumentPart relation in this.GetRelations()) { string relationshipType = relation.GetPackageRelationship().RelationshipType; if (relationshipType.Equals(XWPFRelation.FOOTNOTE.Relation)) { FootnotesDocument footnotesDocument = FootnotesDocument.Parse(relation.GetPackagePart().GetInputStream()); this.footnotes = (XWPFFootnotes)relation; this.footnotes.OnDocumentRead(); foreach (CT_FtnEdn note in footnotesDocument.Footnotes.footnote) { this.footnotes.AddFootnote(note); } } else if (relationshipType.Equals(XWPFRelation.ENDNOTE.Relation)) { foreach (CT_FtnEdn body in EndnotesDocument.Parse(relation.GetPackagePart().GetInputStream()).Endnotes.endnote) { this.endnotes.Add(int.Parse(body.id), new XWPFFootnote(this, body)); } } } }