aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2015-11-21 19:37:26 +0000
committerAndreas Beeker <kiwiwings@apache.org>2015-11-21 19:37:26 +0000
commit01a6730ea7798a5e506053e48b97feae2fded60d (patch)
tree421e6a95c07f32e926b8d1adccaca58d59005b85 /src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
parent74d58c8bde9a00b9b3695665c3b7b12fe2a262f1 (diff)
downloadpoi-01a6730ea7798a5e506053e48b97feae2fded60d.tar.gz
poi-01a6730ea7798a5e506053e48b97feae2fded60d.zip
#58617 - Add custom safe XmlBeans type loader / rename vendor specific schema packages
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1715555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java')
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
index ecdf71d791..c97ccd4507 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnotes.java
@@ -17,13 +17,13 @@
package org.apache.poi.xwpf.usermodel;
+import static org.apache.poi.POIXMLTypeLoader.DEFAULT_XML_OPTIONS;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.xml.namespace.QName;
@@ -32,11 +32,10 @@ import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.util.DocumentHelper;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlOptions;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlOptions;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.FootnotesDocument;
/**
@@ -72,7 +71,7 @@ public class XWPFFootnotes extends POIXMLDocumentPart {
FootnotesDocument notesDoc;
try {
InputStream is = getPackagePart().getInputStream();
- notesDoc = FootnotesDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
+ notesDoc = FootnotesDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
ctFootnotes = notesDoc.getFootnotes();
} catch (XmlException e) {
throw new POIXMLException();
@@ -88,10 +87,6 @@ public class XWPFFootnotes extends POIXMLDocumentPart {
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);