// DEFAULT_XML_OPTIONS.setUnsynchronized();
Map<String, String> map = new HashMap<>();
- map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a");
+ map.put(XSSFRelation.NS_DRAWINGML, "a");
map.put("http://schemas.openxmlformats.org/drawingml/2006/chart", "c");
map.put("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wp");
map.put(PackageNamespaces.MARKUP_COMPATIBILITY, "ve");
package org.apache.poi.xslf.model;
import static org.apache.poi.ooxml.util.XPathHelper.selectProperty;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_DRAWINGML;
import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_PRESENTATIONML;
import java.util.function.Consumer;
static final String PML_NS = NS_PRESENTATIONML;
- static final String DML_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
+ static final String DML_NS = NS_DRAWINGML;
private static final QName[] TX_BODY = { new QName(PML_NS, "txBody") };
private static final QName[] LST_STYLE = { new QName(DML_NS, "lstStyle") };
import org.apache.poi.ooxml.POIXMLRelation;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.util.Beta;
+import org.apache.poi.xssf.usermodel.XSSFRelation;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@SuppressWarnings({"unused", "WeakerAccess"})
@Beta
public final class XSLFRelation extends POIXMLRelation {
- /* package */ static final String NS_DRAWINGML = "http://schemas.openxmlformats.org/drawingml/2006/main";
+ /* package */ static final String NS_DRAWINGML = XSSFRelation.NS_DRAWINGML;
/**
* A map to lookup POIXMLRelation by its relation type
import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_DRAWINGML;
import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_PRESENTATIONML;
/**
T parse(XMLStreamReader reader) throws XmlException;
}
- static final String DML_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
+ static final String DML_NS = NS_DRAWINGML;
static final String PML_NS = NS_PRESENTATIONML;
private static final QName[] NV_CONTAINER = {
import org.apache.xmlbeans.XmlObject;
import org.apache.poi.util.Internal;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_DRAWINGML;
+
/**
* Used internally to navigate the paragraph text style hierarchy within a shape and fetch properties
*/
XmlObject[] o = shape.selectPath(
"declare namespace xdr='http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing' " +
- "declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' " +
+ "declare namespace a='" + NS_DRAWINGML + "' " +
".//xdr:txBody/a:lstStyle/a:lvl" + (_level + 1) + "pPr"
);
if (o.length == 1) {
package org.apache.poi.xddf.usermodel;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_DRAWINGML;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.xmlunit.diff.Diff;
class TestXDDFColor {
- private static final String XMLNS = "xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"/>";
+ private static final String XMLNS = "xmlns:a=\"" + NS_DRAWINGML + "\"/>";
@Test
void testSchemeColor() throws IOException {
==================================================================== */
package org.apache.poi.xssf.usermodel;
+import static org.apache.poi.xssf.usermodel.XSSFRelation.NS_DRAWINGML;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
// Ensure it got the right namespaces
String xml = ctDrawing.toString();
assertTrue(xml.contains("xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\""));
- assertTrue(xml.contains("xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\""));
+ assertTrue(xml.contains("xmlns:a=\"" + NS_DRAWINGML + '\"'));
checkRewrite(wb2);
wb2.close();