Add default XmlOptions to XMLBeans parsing

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1714288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2015-11-14 02:41:48 +00:00
parent 9ab28f52ab
commit c6f11991e7

View File

@ -21,6 +21,7 @@ package org.apache.poi.xslf.usermodel;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackagePart;
@ -48,7 +49,7 @@ public class XSLFMetroShape {
try { try {
pkg = OPCPackage.open(new ByteArrayInputStream(metroBytes)); pkg = OPCPackage.open(new ByteArrayInputStream(metroBytes));
PackagePart shapePart = pkg.getPart(shapePN); PackagePart shapePart = pkg.getPart(shapePN);
CTGroupShape gs = CTGroupShape.Factory.parse(shapePart.getInputStream()); CTGroupShape gs = CTGroupShape.Factory.parse(shapePart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
XSLFGroupShape xgs = new XSLFGroupShape(gs, null); XSLFGroupShape xgs = new XSLFGroupShape(gs, null);
return xgs.getShapes().get(0); return xgs.getShapes().get(0);
} finally { } finally {