DEFAULT_XML_OPTIONS.setUseDefaultNamespace();
DEFAULT_XML_OPTIONS.setSaveAggressiveNamespaces();
DEFAULT_XML_OPTIONS.setCharacterEncoding("UTF-8");
+ DEFAULT_XML_OPTIONS.setLoadEntityBytesLimit(4096);
}
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
import org.apache.poi.openxml4j.util.Nullable;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlOptions;
import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty;
if(extRel.size() == 1) {
extPart = pkg.getPart( extRel.getRelationship(0));
org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument.Factory.parse(
- extPart.getInputStream()
+ extPart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
ext = new ExtendedProperties(props);
} else {
if(custRel.size() == 1) {
custPart = pkg.getPart( custRel.getRelationship(0));
org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument props = org.openxmlformats.schemas.officeDocument.x2006.customProperties.PropertiesDocument.Factory.parse(
- custPart.getInputStream()
+ custPart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
cust = new CustomProperties(props);
} else {
import java.io.InputStream;\r
\r
import org.apache.poi.EncryptedDocumentException;\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.poifs.crypt.ChainingMode;\r
import org.apache.poi.poifs.crypt.CipherAlgorithm;\r
import org.apache.poi.poifs.crypt.EncryptionInfo;\r
\r
protected static EncryptionDocument parseDescriptor(String descriptor) {\r
try {\r
- return EncryptionDocument.Factory.parse(descriptor);\r
+ return EncryptionDocument.Factory.parse(descriptor, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (XmlException e) {\r
throw new EncryptedDocumentException("Unable to parse encryption descriptor", e);\r
}\r
\r
protected static EncryptionDocument parseDescriptor(InputStream descriptor) {\r
try {\r
- return EncryptionDocument.Factory.parse(descriptor);\r
+ return EncryptionDocument.Factory.parse(descriptor, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (Exception e) {\r
throw new EncryptedDocumentException("Unable to parse encryption descriptor", e);\r
}\r
import org.apache.jcp.xml.dsig.internal.dom.DOMReference;\r
import org.apache.jcp.xml.dsig.internal.dom.DOMSignedInfo;\r
import org.apache.poi.EncryptedDocumentException;\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;\r
import org.apache.poi.openxml4j.opc.ContentTypes;\r
import org.apache.poi.openxml4j.opc.OPCPackage;\r
*/\r
public SignatureDocument getSignatureDocument() throws IOException, XmlException {\r
// TODO: check for XXE\r
- return SignatureDocument.Factory.parse(signaturePart.getInputStream());\r
+ return SignatureDocument.Factory.parse(signaturePart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
}\r
\r
/**\r
\r
try {\r
OutputStream os = sigPart.getOutputStream();\r
- SignatureDocument sigDoc = SignatureDocument.Factory.parse(document);\r
+ SignatureDocument sigDoc = SignatureDocument.Factory.parse(document, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
sigDoc.save(os, xo);\r
os.close();\r
} catch (Exception e) {\r
\r
import javax.xml.crypto.MarshalException;\r
\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.xmlbeans.XmlException;\r
import org.etsi.uri.x01903.v13.QualifyingPropertiesType;\r
import org.etsi.uri.x01903.v13.UnsignedPropertiesType;\r
\r
QualifyingPropertiesType qualProps;\r
try {\r
- qualProps = QualifyingPropertiesType.Factory.parse(nl.item(0));\r
+ qualProps = QualifyingPropertiesType.Factory.parse(nl.item(0), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (XmlException e) {\r
throw new MarshalException(e);\r
}\r
\r
import javax.xml.crypto.MarshalException;\r
\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.poifs.crypt.dsig.services.RevocationData;\r
import org.apache.poi.util.POILogFactory;\r
import org.apache.poi.util.POILogger;\r
NodeList qualNl = document.getElementsByTagNameNS(XADES_132_NS, "QualifyingProperties");\r
if (qualNl.getLength() == 1) {\r
try {\r
- qualDoc = QualifyingPropertiesDocument.Factory.parse(qualNl.item(0));\r
+ qualDoc = QualifyingPropertiesDocument.Factory.parse(qualNl.item(0), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (XmlException e) {\r
throw new MarshalException(e);\r
}\r
import javax.xml.crypto.dsig.TransformService;\r
import javax.xml.crypto.dsig.spec.TransformParameterSpec;\r
\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.util.POILogFactory;\r
import org.apache.poi.util.POILogger;\r
import org.apache.poi.util.XmlSort;\r
Node parentNode = domParent.getNode();\r
\r
try {\r
- TransformDocument transDoc = TransformDocument.Factory.parse(parentNode);\r
+ TransformDocument transDoc = TransformDocument.Factory.parse(parentNode, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
XmlObject xoList[] = transDoc.getTransform().selectChildren(RelationshipReferenceDocument.type.getDocumentElementName());\r
if (xoList.length == 0) {\r
LOG.log(POILogger.WARN, "no RelationshipReference/@SourceId parameters present");\r
\r
RelationshipsDocument relDoc;\r
try {\r
- relDoc = RelationshipsDocument.Factory.parse(octetStream);\r
+ relDoc = RelationshipsDocument.Factory.parse(octetStream, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (Exception e) {\r
throw new TransformException(e.getMessage(), e);\r
}\r
public final class DocumentHelper {
private static POILogger logger = POILogFactory.getLogger(DocumentHelper.class);
-
+
private DocumentHelper() {}
/**
\r
import javax.xml.namespace.QName;\r
\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.xmlbeans.XmlCursor;\r
import org.apache.xmlbeans.XmlException;\r
import org.apache.xmlbeans.XmlObject;\r
File f = new File(args[0]);\r
try\r
{\r
- XmlObject docInstance = XmlObject.Factory.parse(f);\r
+ XmlObject docInstance = XmlObject.Factory.parse(f, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
XmlObject element = null;\r
if (args.length > 1)\r
{\r
import org.apache.poi.sl.usermodel.Resources;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
protected void onDocumentRead() throws IOException {
try {
PresentationDocument doc =
- PresentationDocument.Factory.parse(getCorePart().getInputStream());
+ PresentationDocument.Factory.parse(getCorePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_presentation = doc.getPresentation();
Map<String, XSLFSlideMaster> masterMap = new HashMap<String, XSLFSlideMaster>();
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlOptions;
protected XSLFChart(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
- chartSpace = ChartSpaceDocument.Factory.parse(part.getInputStream()).getChartSpace();
+ chartSpace = ChartSpaceDocument.Factory.parse(part.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getChartSpace();
chart = chartSpace.getChart();
}
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentAuthor;
import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentAuthorList;
super(part, rel);
CmAuthorLstDocument doc =
- CmAuthorLstDocument.Factory.parse(getPackagePart().getInputStream());
+ CmAuthorLstDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_authors = doc.getCmAuthorLst();
}
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.presentationml.x2006.main.CTComment;
import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentList;
super(part, rel);
CmLstDocument doc =
- CmLstDocument.Factory.parse(getPackagePart().getInputStream());
+ CmLstDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_comments = doc.getCmLst();
}
import java.util.Arrays;
import java.util.List;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.util.Beta;
import org.apache.xmlbeans.XmlCursor;
if (o instanceof XmlAnyTypeImpl) {
// Pesky XmlBeans bug - see Bugzilla #49934
try {
- o = CTTable.Factory.parse(o.toString());
+ o = CTTable.Factory.parse(o.toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
} catch (XmlException e) {
throw new POIXMLException(e);
}
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.sl.usermodel.Notes;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.presentationml.x2006.main.CTCommonSlideData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesSlide;
super(part, rel);
NotesDocument doc =
- NotesDocument.Factory.parse(getPackagePart().getInputStream());
+ NotesDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_notes = doc.getNotes();
setCommonSlideData(_notes.getCSld());
}
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.sl.usermodel.MasterSheet;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping;
import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesMaster;
protected XSLFNotesMaster(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
NotesMasterDocument doc =
- NotesMasterDocument.Factory.parse(getPackagePart().getInputStream());
+ NotesMasterDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_slide = doc.getNotesMaster();
setCommonSlideData(_slide.getCSld());
}
try {
try {
- NotesMasterDocument doc = NotesMasterDocument.Factory.parse(is);
+ NotesMasterDocument doc = NotesMasterDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
CTNotesMaster slide = doc.getNotesMaster();
return slide;
} finally {
import org.apache.poi.sl.usermodel.Notes;
import org.apache.poi.sl.usermodel.Slide;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.drawingml.x2006.main.CTBlip;
import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties;
super(part, rel);
SldDocument doc =
- SldDocument.Factory.parse(getPackagePart().getInputStream());
+ SldDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_slide = doc.getSld();
setCommonSlideData(_slide.getCSld());
}
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.sl.usermodel.MasterSheet;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground;
public XSLFSlideLayout(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
SldLayoutDocument doc =
- SldLayoutDocument.Factory.parse(getPackagePart().getInputStream());
+ SldLayoutDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_layout = doc.getSldLayout();
setCommonSlideData(_layout.getCSld());
}
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.sl.usermodel.MasterSheet;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextListStyle;
protected XSLFSlideMaster(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
SldMasterDocument doc =
- SldMasterDocument.Factory.parse(getPackagePart().getInputStream());
+ SldMasterDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_slide = doc.getSldMaster();
setCommonSlideData(_slide.getCSld());
}
import java.util.List;
import org.apache.poi.POIXMLDocument;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
}
presentationDoc =
- PresentationDocument.Factory.parse(getCorePart().getInputStream());
+ PresentationDocument.Factory.parse(getCorePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
embedds = new LinkedList<PackagePart>();
for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) {
public CTSlideMaster getSlideMaster(CTSlideMasterIdListEntry master) throws IOException, XmlException {
PackagePart masterPart = getSlideMasterPart(master);
SldMasterDocument masterDoc =
- SldMasterDocument.Factory.parse(masterPart.getInputStream());
+ SldMasterDocument.Factory.parse(masterPart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
return masterDoc.getSldMaster();
}
public CTSlide getSlide(CTSlideIdListEntry slide) throws IOException, XmlException {
PackagePart slidePart = getSlidePart(slide);
SldDocument slideDoc =
- SldDocument.Factory.parse(slidePart.getInputStream());
+ SldDocument.Factory.parse(slidePart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
return slideDoc.getSld();
}
return null;
NotesDocument notesDoc =
- NotesDocument.Factory.parse(notesPart.getInputStream());
+ NotesDocument.Factory.parse(notesPart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
return notesDoc.getNotes();
}
commentRels.getRelationship(0)
);
CmLstDocument commDoc =
- CmLstDocument.Factory.parse(cPart.getInputStream());
+ CmLstDocument.Factory.parse(cPart.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
return commDoc.getCmLst();
} catch(InvalidFormatException e) {
throw new IllegalStateException(e);
\r
import javax.xml.namespace.QName;\r
\r
+import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.POIXMLException;\r
import org.apache.poi.sl.usermodel.TableShape;\r
import org.apache.poi.util.Internal;\r
// it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas\r
if(rs[0] instanceof XmlAnyTypeImpl){\r
try {\r
- rs[0] = CTTable.Factory.parse(rs[0].toString());\r
+ rs[0] = CTTable.Factory.parse(rs[0].toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
}catch (XmlException e){\r
throw new POIXMLException(e);\r
}\r
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableStyle;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableStyleList;
public XSLFTableStyles(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
- _tblStyleLst = CTTableStyleList.Factory.parse(getPackagePart().getInputStream());
+ _tblStyleLst = CTTableStyleList.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
CTTableStyle[] tblStyleArray = _tblStyleLst.getTblStyleArray();
_styles = new ArrayList<XSLFTableStyle>(tblStyleArray.length);
for(CTTableStyle c : tblStyleArray){
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
public XSLFTheme(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
ThemeDocument doc =
- ThemeDocument.Factory.parse(getPackagePart().getInputStream());
+ ThemeDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_theme = doc.getTheme();
initialize();
}
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
import org.apache.poi.util.IOUtils;
import org.apache.xmlbeans.XmlObject;
try {
if(entry.getName().endsWith(".xml") || entry.getName().endsWith(".vml") || entry.getName().endsWith(".rels")){
try {
- XmlObject xml = XmlObject.Factory.parse(zip.getInputStream(entry));
+ XmlObject xml = XmlObject.Factory.parse(zip.getInputStream(entry), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
XmlOptions options = new XmlOptions();
options.setSavePrettyPrint();
xml.save(out, options);
import java.util.List;
import java.util.Map;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
}
//step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
//Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
- CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
+ CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getWorkbook();
sheetIterator = wbBean.getSheets().getSheetList().iterator();
} catch (InvalidFormatException e){
throw new POIXMLException(e);
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
/**
* The cells in a workbook can be calculated in different orders depending on various optimizations and
public void readFrom(InputStream is) throws IOException {
try {
- CalcChainDocument doc = CalcChainDocument.Factory.parse(is);
+ CalcChainDocument doc = CalcChainDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
chain = doc.getCalcChain();
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.XSSFComment;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment;
public void readFrom(InputStream is) throws IOException {
try {
- CommentsDocument doc = CommentsDocument.Factory.parse(is);
+ CommentsDocument doc = CommentsDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
comments = doc.getComments();
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.ss.usermodel.Name;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTExternalDefinedName;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTExternalLink;
public void readFrom(InputStream is) throws IOException {
try {
- ExternalLinkDocument doc = ExternalLinkDocument.Factory.parse(is);
+ ExternalLinkDocument doc = ExternalLinkDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
link = doc.getExternalLink();
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.XSSFMap;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.xmlbeans.XmlException;
@SuppressWarnings("deprecation")
public void readFrom(InputStream is) throws IOException {
try {
- MapInfoDocument doc = MapInfoDocument.Factory.parse(is);
+ MapInfoDocument doc = MapInfoDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
mapInfo = doc.getMapInfo();
maps= new HashMap<Integer, XSSFMap>();
import org.apache.poi.POIXMLDocumentPart;
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.spreadsheetml.x2006.main.CTRst;
public void readFrom(InputStream is) throws IOException {
try {
int cnt = 0;
- _sstDoc = SstDocument.Factory.parse(is);
+ _sstDoc = SstDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
CTSst sst = _sstDoc.getSst();
count = (int)sst.getCount();
uniqueCount = (int)sst.getUniqueCount();
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.helpers.XSSFSingleXmlCell;
import org.apache.xmlbeans.XmlException;
public void readFrom(InputStream is) throws IOException {
try {
- SingleXmlCellsDocument doc = SingleXmlCellsDocument.Factory.parse(is);
+ SingleXmlCellsDocument doc = SingleXmlCellsDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
singleXMLCells = doc.getSingleXmlCells();
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.FontFamily;
import org.apache.poi.ss.usermodel.FontScheme;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFactory;
import org.apache.poi.xssf.usermodel.XSSFFont;
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected void readFrom(InputStream is) throws IOException {
try {
- doc = StyleSheetDocument.Factory.parse(is);
+ doc = StyleSheetDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
CTStylesheet styleSheet = doc.getStyleSheet();
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlOptions;
super(part, rel);
try {
- theme = ThemeDocument.Factory.parse(part.getInputStream());
+ theme = ThemeDocument.Factory.parse(part.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
} catch(XmlException e) {
throw new IOException(e.getLocalizedMessage(), e);
}
package org.apache.poi.xssf.usermodel;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.CellStyle;
// Create a new Xf with the same contents
_cellXf = CTXf.Factory.parse(
- src.getCoreXf().toString()
+ src.getCoreXf().toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
// bug 56295: ensure that the fills is available and set correctly
CTFill fill = CTFill.Factory.parse(
- src.getCTFill().toString()
+ src.getCTFill().toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
addFill(fill);
// Copy the font
try {
CTFont ctFont = CTFont.Factory.parse(
- src.getFont().getCTFont().toString()
+ src.getFont().getCTFont().toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
XSSFFont font = new XSSFFont(ctFont);
font.registerTo(_stylesSource);
import org.apache.poi.ss.usermodel.charts.ChartAxis;
import org.apache.poi.ss.usermodel.charts.ChartAxisFactory;
import org.apache.poi.ss.usermodel.charts.ChartData;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.charts.XSSFCategoryAxis;
import org.apache.poi.xssf.usermodel.charts.XSSFChartAxis;
protected XSSFChart(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
- chartSpace = ChartSpaceDocument.Factory.parse(part.getInputStream()).getChartSpace();
+ chartSpace = ChartSpaceDocument.Factory.parse(part.getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getChartSpace();
chart = chartSpace.getChart();
}
import javax.xml.namespace.QName;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
super.read(new ByteArrayInputStream(BLANK_WORKSHEET));
try {
- chartsheet = ChartsheetDocument.Factory.parse(is).getChartsheet();
+ chartsheet = ChartsheetDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getChartsheet();
} catch (XmlException e){
throw new POIXMLException(e);
}
import org.apache.poi.ss.util.SSCellRange;
import org.apache.poi.ss.util.SheetUtil;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.Internal;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
protected void read(InputStream is) throws IOException {
try {
- worksheet = WorksheetDocument.Factory.parse(is).getWorksheet();
+ worksheet = WorksheetDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getWorksheet();
} catch (XmlException e){
throw new POIXMLException(e);
}
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.ss.util.CellReference;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.usermodel.helpers.XSSFXmlColumnPr;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTable;
public void readFrom(InputStream is) throws IOException {
try {
- TableDocument doc = TableDocument.Factory.parse(is);
+ TableDocument doc = TableDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
ctTable = doc.getTable();
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.xssf.util.EvilUnclosedBRFixingInputStream;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlOptions;
protected void read(InputStream is) throws IOException, XmlException {
XmlObject root = XmlObject.Factory.parse(
- new EvilUnclosedBRFixingInputStream(is)
+ new EvilUnclosedBRFixingInputStream(is), POIXMLDocumentPart.DEFAULT_XML_OPTIONS
);
_qnames = new ArrayList<QName>();
Node nd = obj.getDomNode();
QName qname = new QName(nd.getNamespaceURI(), nd.getLocalName());
if (qname.equals(QNAME_SHAPE_LAYOUT)) {
- _items.add(CTShapeLayout.Factory.parse(obj.xmlText()));
+ _items.add(CTShapeLayout.Factory.parse(obj.xmlText(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS));
} else if (qname.equals(QNAME_SHAPE_TYPE)) {
- CTShapetype st = CTShapetype.Factory.parse(obj.xmlText());
+ CTShapetype st = CTShapetype.Factory.parse(obj.xmlText(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
_items.add(st);
_shapeTypeId = st.getId();
} else if (qname.equals(QNAME_SHAPE)) {
- CTShape shape = CTShape.Factory.parse(obj.xmlText());
+ CTShape shape = CTShape.Factory.parse(obj.xmlText(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
String id = shape.getId();
if(id != null) {
Matcher m = ptrn_shapeId.matcher(id);
}
_items.add(shape);
} else {
- _items.add(XmlObject.Factory.parse(obj.xmlText()));
+ _items.add(XmlObject.Factory.parse(obj.xmlText(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS));
}
_qnames.add(qname);
}
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.ss.util.WorkbookUtil;
import org.apache.poi.util.Beta;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Internal;
import org.apache.poi.util.POILogFactory;
@SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
protected void onDocumentRead() throws IOException {
try {
- WorkbookDocument doc = WorkbookDocument.Factory.parse(getPackagePart().getInputStream());
+ WorkbookDocument doc = WorkbookDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
this.workbook = doc.getWorkbook();
ThemesTable theme = null;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.poifs.crypt.HashAlgorithm;
+import org.apache.poi.util.DocumentHelper;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.IdentifierManager;
import org.apache.poi.util.Internal;
@Override
protected void onDocumentRead() throws IOException {
try {
- DocumentDocument doc = DocumentDocument.Factory.parse(getPackagePart().getInputStream());
+ DocumentDocument doc = DocumentDocument.Factory.parse(getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
ctDocument = doc.getDocument();
initFootnotes();
header.onDocumentRead();
} else if (relation.equals(XWPFRelation.COMMENT.getRelation())) {
// TODO Create according XWPFComment class, extending POIXMLDocumentPart
- CommentsDocument cmntdoc = CommentsDocument.Factory.parse(p.getPackagePart().getInputStream());
+ CommentsDocument cmntdoc = CommentsDocument.Factory.parse(p.getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
for (CTComment ctcomment : cmntdoc.getComments().getCommentArray()) {
comments.add(new XWPFComment(ctcomment, this));
}
this.footnotes = (XWPFFootnotes) p;
this.footnotes.onDocumentRead();
} else if (relation.equals(XWPFRelation.ENDNOTE.getRelation())) {
- EndnotesDocument endnotesDocument = EndnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
+ EndnotesDocument endnotesDocument = EndnotesDocument.Factory.parse(p.getPackagePart().getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
for (CTFtnEdn ctFtnEdn : endnotesDocument.getEndnotes().getEndnoteArray()) {
endnotes.put(ctFtnEdn.getId().intValue(), new XWPFFootnote(this, ctFtnEdn));
throw new IllegalStateException("Expecting one Styles document part, but found " + parts.length);
}
- StylesDocument sd = StylesDocument.Factory.parse(parts[0].getInputStream());
+ StylesDocument sd = StylesDocument.Factory.parse(parts[0].getInputStream(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
return sd.getStyles();
}
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
InputStream is;
try {
is = getPackagePart().getInputStream();
- ftrDocument = FtrDocument.Factory.parse(is);
+ ftrDocument = FtrDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
headerFooter = ftrDocument.getFtr();
// parse the document with cursor and add
// the XmlObject to its lists
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;\r
+import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;\r
import org.apache.xmlbeans.XmlOptions;\r
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes;\r
FootnotesDocument notesDoc;\r
try {\r
InputStream is = getPackagePart().getInputStream();\r
- notesDoc = FootnotesDocument.Factory.parse(is);
+ notesDoc = FootnotesDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
ctFootnotes = notesDoc.getFootnotes();
} catch (XmlException e) {
throw new POIXMLException();
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
InputStream is;
try {
is = getPackagePart().getInputStream();
- hdrDocument = HdrDocument.Factory.parse(is);
+ hdrDocument = HdrDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
headerFooter = hdrDocument.getHdr();
// parse the document with cursor and add
// the XmlObject to its lists
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.CTAbstractNum;
InputStream is;\r
is = getPackagePart().getInputStream();\r
try {\r
- numberingDoc = NumberingDocument.Factory.parse(is);\r
+ numberingDoc = NumberingDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
ctNumbering = numberingDoc.getNumbering();\r
//get any Nums\r
for (CTNum ctNum : ctNumbering.getNumArray()) {\r
import javax.xml.namespace.QName;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlString;\r
-import org.apache.xmlbeans.XmlToken;\r
-import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTBlip;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObjectData;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType;\r
-import org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture;\r
-import org.openxmlformats.schemas.drawingml.x2006.picture.CTPictureNonVisual;\r
-import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor;\r
-import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEmpty;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFFCheckBox;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFldChar;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFonts;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdnRef;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHpsMeasure;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSignedHpsMeasure;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSignedTwipsMeasure;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTUnderline;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalAlignRun;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBrClear;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBrType;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STFldCharType;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STUnderline;\r
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalAlignRun;\r
-import org.w3c.dom.NodeList;\r
+import org.apache.xmlbeans.XmlString;
+import org.apache.xmlbeans.XmlToken;
+import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTBlip;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObjectData;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D;
+import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType;
+import org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture;
+import org.openxmlformats.schemas.drawingml.x2006.picture.CTPictureNonVisual;
+import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor;
+import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTEmpty;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFFCheckBox;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFldChar;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFonts;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdnRef;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHpsMeasure;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSignedHpsMeasure;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSignedTwipsMeasure;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTUnderline;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalAlignRun;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBrClear;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBrType;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STFldCharType;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STUnderline;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalAlignRun;
+import org.w3c.dom.NodeList;
import org.w3c.dom.Text;\r
\r
/**
if (pict instanceof XmlAnyTypeImpl) {\r
// Pesky XmlBeans bug - see Bugzilla #49934\r
try {\r
- pict = CTPicture.Factory.parse(pict.toString());\r
+ pict = CTPicture.Factory.parse(pict.toString(), POIXMLDocumentPart.DEFAULT_XML_OPTIONS);\r
} catch (XmlException e) {\r
throw new POIXMLException(e);\r
}\r
"<pic:pic xmlns:pic=\"" + CTPicture.type.getName().getNamespaceURI() + "\" />" +\r
"</a:graphicData>" +\r
"</a:graphic>";\r
- inline.set(XmlToken.Factory.parse(xml));\r
+ inline.set(XmlToken.Factory.parse(xml, POIXMLDocumentPart.DEFAULT_XML_OPTIONS));\r
\r
// Setup the inline\r
inline.setDistT(0);
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.poifs.crypt.CryptoFunctions;
import org.apache.poi.poifs.crypt.HashAlgorithm;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlOptions;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocProtect;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff;
private void readFrom(InputStream inputStream) {
try {
- ctSettings = SettingsDocument.Factory.parse(inputStream).getSettings();
+ ctSettings = SettingsDocument.Factory.parse(inputStream, POIXMLDocumentPart.DEFAULT_XML_OPTIONS).getSettings();
} catch (Exception e) {
throw new RuntimeException(e);
}
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;\r
+import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.util.DocumentHelper;
import org.apache.xmlbeans.XmlException;\r
import org.apache.xmlbeans.XmlOptions;\r
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocDefaults;\r
StylesDocument stylesDoc;\r
try {\r
InputStream is = getPackagePart().getInputStream();\r
- stylesDoc = StylesDocument.Factory.parse(is);
+ stylesDoc = StylesDocument.Factory.parse(is, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
setStyles(stylesDoc.getStyles());
latentStyles = new XWPFLatentStyles(ctStyles.getLatentStyles(), this);
} catch (XmlException e) {