} else if (e instanceof OdfDrawImage) {
addImage((OdfDrawImage) e, dstElement);
} else if (e instanceof OdfTextList) {
OdfTextList otl = (OdfTextList) e;
dstElement = getCurrentResource().getDocument().getBody();
/**
* ul.a {list-style-type:circle;} ul.b {list-style-type:square;}
* ol.c {list-style-type:upper-roman;} ol.d
* {list-style-type:lower-alpha;}
*/
Object n = getXpath().evaluate(
"//text:list-style[@style:name='" + otl.getTextStyleNameAttribute()
+ "']/text:list-level-style-bullet", getOdt().getContentDom(), XPathConstants.NODE);
if (n != null) {// is a bullet list
newElement = getCurrentResource().getDocument().createElement("ul");
} else {
n = getXpath().evaluate(
"//text:list-style[@style:name='" + otl.getTextStyleNameAttribute()
+ "']/text:list-level-style-number", getOdt().getContentDom(), XPathConstants.NODE);
if (n != null) {
newElement = getCurrentResource().getDocument().createElement("ol");
}
}
if (newElement != null) {
dstElement.add(newElement);
newElement.setClassName(otl.getTextStyleNameAttribute());
}
// title[@lang='eng']
} else if (e instanceof TextListItemElement) {
TextListItemElement li = (TextListItemElement) e;
newElement = getCurrentResource().getDocument().createElement("li");
dstElement.add(newElement);
} else if (e instanceof TableTableElement) {
TableTableElement otl = (TableTableElement) e;
dstElement = getCurrentResource().getDocument().getBody();
newElement = getCurrentResource().getDocument().createElement("table");
dstElement.add(newElement);
newElement.setClassName(otl.getStyleName());
Selector selector = getStylesheet().getSimpleSelector(null, otl.getStyleName());
SelectorRule rule = getStylesheet().getRuleForSelector(selector, true);
rule.set("width", new CSSName("100%"));
selector = getStylesheet().getSimpleSelector("table", null);
rule = getStylesheet().getRuleForSelector(selector, true);
rule.set("border-collapse", new CSSName("collapse"));
rule.set("border", new CSSName("1px solid black"));
selector = getStylesheet().getSimpleSelector("td",null);
rule = getStylesheet().getRuleForSelector(selector, true);
rule.set("border", new CSSName("1px solid black"));
selector = getStylesheet().getSimpleSelector("tr", null);
rule = getStylesheet().getRuleForSelector(selector, true);
rule.set("border", new CSSName("1px solid black"));
} else if (e instanceof TableTableRowElement) {
TableTableRowElement otl = (TableTableRowElement) e;
newElement = getCurrentResource().getDocument().createElement("tr");
dstElement.add(newElement);
newElement.setClassName(otl.getStyleName());
} else if (e instanceof TableTableCellElement) {
TableTableCellElement otl = (TableTableCellElement) e;
newElement = getCurrentResource().getDocument().createElement("td");
dstElement.add(newElement);
newElement.setClassName(otl.getStyleName());
} else if (e instanceof OdfTextHeading) {// text:p
// System.out.println(e.getTextContent());
OdfTextHeading oth = (OdfTextHeading) e;
if (hasPageBreak(oth)) {
createNewResource();