use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSLFTheme method commit.
protected final void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "theme"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
getXmlObject().save(out, xmlOptions);
out.close();
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotCacheDefinition 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(CTPivotCacheDefinition.type.getName().getNamespaceURI(), "pivotCacheDefinition"));
ctPivotCacheDefinition.save(out, xmlOptions);
out.close();
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotTable method commit.
@Beta
@Override
protected void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
//Sets the pivotTableDefinition tag
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTPivotTableDefinition.type.getName().getNamespaceURI(), "pivotTableDefinition"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
pivotTableDefinition.save(out, xmlOptions);
out.close();
}
use of org.apache.xmlbeans.XmlOptions in project poi by apache.
the class XSSFPivotCache method readFrom.
@Beta
protected void readFrom(InputStream is) throws IOException {
try {
XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);
//Removing root element
options.setLoadReplaceDocumentElement(null);
ctPivotCache = CTPivotCache.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 XWPFDocument method commit.
/**
* commit and saves the document
*/
@Override
protected void commit() throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDocument1.type.getName().getNamespaceURI(), "document"));
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
ctDocument.save(out, xmlOptions);
out.close();
}
Aggregations