use StaxHelper to get event factory

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-09-30 18:14:46 +00:00
parent 4833c25d32
commit 11dee9b086

View File

@ -29,6 +29,7 @@ import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
import org.apache.poi.openxml4j.opc.internal.PartMarshaller; import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
import org.apache.poi.ooxml.util.DocumentHelper; import org.apache.poi.ooxml.util.DocumentHelper;
import org.apache.poi.util.StaxHelper;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -38,7 +39,7 @@ import org.w3c.dom.Element;
public class PackagePropertiesMarshaller implements PartMarshaller { public class PackagePropertiesMarshaller implements PartMarshaller {
private final static Namespace namespaceDC, namespaceCoreProperties, namespaceDcTerms, namespaceXSI; private final static Namespace namespaceDC, namespaceCoreProperties, namespaceDcTerms, namespaceXSI;
static { static {
final XMLEventFactory f = XMLEventFactory.newInstance(); final XMLEventFactory f = StaxHelper.newXMLEventFactory();
namespaceDC = f.createNamespace("dc", PackagePropertiesPart.NAMESPACE_DC_URI); namespaceDC = f.createNamespace("dc", PackagePropertiesPart.NAMESPACE_DC_URI);
namespaceCoreProperties = f.createNamespace("cp", PackagePropertiesPart.NAMESPACE_CP_URI); namespaceCoreProperties = f.createNamespace("cp", PackagePropertiesPart.NAMESPACE_CP_URI);
namespaceDcTerms = f.createNamespace("dcterms", PackagePropertiesPart.NAMESPACE_DCTERMS_URI); namespaceDcTerms = f.createNamespace("dcterms", PackagePropertiesPart.NAMESPACE_DCTERMS_URI);