@Override protected void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement(new QName(CTFootnotes.type.getName().getNamespaceURI(), "footnotes")); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); ctFootnotes.save(out, xmlOptions); out.close(); }
/** * Read document */ @Override protected void onDocumentRead() throws IOException { FootnotesDocument notesDoc; InputStream is = null; try { is = getPackagePart().getInputStream(); notesDoc = FootnotesDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); ctFootnotes = notesDoc.getFootnotes(); } catch (XmlException e) { throw new POIXMLException(); } finally { if (is != null) { is.close(); } } for (CTFtnEdn note : ctFootnotes.getFootnoteList()) { listFootnote.add(new XWPFFootnote(note, this)); } }
@Override protected void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement(new QName(CTFootnotes.type.getName().getNamespaceURI(), "footnotes")); Map<String,String> map = new HashMap<String,String>(); map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r"); map.put("http://schemas.openxmlformats.org/wordprocessingml/2006/main", "w"); xmlOptions.setSaveSuggestedPrefixes(map); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); ctFootnotes.save(out, xmlOptions); out.close(); }
@Override protected void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement(new QName(CTFootnotes.type.getName().getNamespaceURI(), "footnotes")); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); ctFootnotes.save(out, xmlOptions); out.close(); }
/** * Read document */ @Override protected void onDocumentRead() throws IOException { FootnotesDocument notesDoc; InputStream is = null; try { is = getPackagePart().getInputStream(); notesDoc = FootnotesDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); ctFootnotes = notesDoc.getFootnotes(); } catch (XmlException e) { throw new POIXMLException(); } finally { if (is != null) { is.close(); } } for (CTFtnEdn note : ctFootnotes.getFootnoteList()) { listFootnote.add(new XWPFFootnote(note, this)); } }
/** * Read document */ @Override protected void onDocumentRead () throws IOException { FootnotesDocument notesDoc; try { InputStream is = getPackagePart().getInputStream(); notesDoc = FootnotesDocument.Factory.parse(is); ctFootnotes = notesDoc.getFootnotes(); } catch (XmlException e) { throw new POIXMLException(); } //get any Footnote for(CTFtnEdn note : ctFootnotes.getFootnoteList()) { listFootnote.add(new XWPFFootnote(note, this)); } }