use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFDrawing method commit.
@Override
protected void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
/*
Saved drawings must have the following namespaces set:
<xdr:wsDr
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
*/
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
drawing.save(out, xmlOptions);
out.close();
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotCacheDefinition method readFrom.
@Beta
public void readFrom(InputStream is) throws IOException {
try {
XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);
//Removing root element
options.setLoadReplaceDocumentElement(null);
ctPivotCacheDefinition = CTPivotCacheDefinition.Factory.parse(is, options);
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage(), e);
}
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotCacheRecords method readFrom.
@Beta
protected void readFrom(InputStream is) throws IOException {
try {
XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);
//Removing root element
options.setLoadReplaceDocumentElement(null);
ctPivotCacheRecords = CTPivotCacheRecords.Factory.parse(is, options);
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
}
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotCacheRecords method commit.
@Beta
@Override
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
//Sets the pivotCacheDefinition tag
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTPivotCacheRecords.type.getName().getNamespaceURI(), "pivotCacheRecords"));
ctPivotCacheRecords.save(out, xmlOptions);
out.close();
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotTable method readFrom.
@Beta
public void readFrom(InputStream is) throws IOException {
try {
XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);
//Removing root element
options.setLoadReplaceDocumentElement(null);
pivotTableDefinition = CTPivotTableDefinition.Factory.parse(is, options);
} catch (XmlException e) {
throw new IOException(e.getLocalizedMessage());
}
}
Aggregations