public class WDocument extends Welement
| 限定符和类型 | 字段和说明 |
|---|---|
boolean |
IS_HTML_ESCAPE |
| 限定符和类型 | 方法和说明 |
|---|---|
org.dom4j.Element |
after(org.dom4j.Element point,
org.dom4j.Element element) |
org.dom4j.Element |
after(org.dom4j.Element element,
String html)
在element之后 插入节点
解析html有可能解析出多个element这里会返回最外层的最后一个
|
org.dom4j.Element |
after(org.dom4j.Element point,
Wtable table) |
org.dom4j.Element |
before(org.dom4j.Element point,
org.dom4j.Element element) |
org.dom4j.Element |
before(org.dom4j.Element element,
String html)
在element之前插入节点
|
org.dom4j.Element |
before(org.dom4j.Element point,
Wtable table) |
org.dom4j.Element |
block(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element element,
Map<String,String> styles) |
void |
flush() |
static int |
index(org.dom4j.Element parent,
org.dom4j.Element element) |
org.dom4j.Element |
insert(org.dom4j.Element parent,
org.dom4j.Element element) |
org.dom4j.Element |
insert(org.dom4j.Element prev,
File file)
插入模板文件
|
org.dom4j.Element |
insert(org.dom4j.Element parent,
String html) |
org.dom4j.Element |
insert(org.dom4j.Element parent,
Wtable table) |
org.dom4j.Element |
insert(int index,
org.dom4j.Element parent,
org.dom4j.Element element) |
org.dom4j.Element |
insert(int index,
org.dom4j.Element parent,
String html) |
org.dom4j.Element |
insert(int index,
org.dom4j.Element parent,
Wtable table) |
void |
insertPageBreak(org.dom4j.Element prev) |
String |
listStyle(String key)
根据关键字查找样式列表ID
|
List<String> |
listStyles()
根据关键字查找样式列表ID
|
void |
loadStyle(String html) |
org.dom4j.Element |
p(org.dom4j.Element element) |
org.dom4j.Element |
p(org.dom4j.Element parent,
String text,
Map<String,String> styles) |
org.dom4j.Element |
parent(org.dom4j.Element element,
String... tags) |
org.dom4j.Element |
parent(String bookmark) |
org.dom4j.Element |
parent(String bookmark,
String tag)
获取书签所在的标签 通常用来定位
|
org.dom4j.Element |
parseHtml(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element html,
Map<String,String> styles) |
org.dom4j.Element |
parseHtml(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element html,
Map<String,String> styles,
boolean copyPrevStyle)
解析html
|
org.dom4j.Element |
pp(org.dom4j.Element element)
找到到当前p的上一级(用来创建与当前所在p平级的新p,遇到tc停止)
|
org.dom4j.Element |
pr(org.dom4j.Element element,
Map<String,String> styles) |
org.dom4j.Element |
prevStyle(org.dom4j.Element prev) |
org.dom4j.Element |
r(org.dom4j.Element parent,
String text,
Map<String,String> styles) |
void |
reload() |
WDocument |
remove(org.dom4j.Element element) |
WDocument |
remove(Wtable table) |
void |
replace(org.dom4j.Element box,
Map<String,String> replaces)
执行替换
|
void |
replace(String key,
String content) |
void |
save() |
void |
save(Charset charset) |
void |
setOrient(org.dom4j.Element prev,
String orient) |
void |
setOrient(org.dom4j.Element prev,
String orient,
Map<String,String> styles) |
Map<String,String> |
style(org.dom4j.Element element) |
org.dom4j.Element |
table(org.dom4j.Element box,
org.dom4j.Element after,
org.dom4j.Element src) |
Wtable |
table(String bookmark) |
List<Wtable> |
tables() |
List<Wtable> |
tables(boolean recursion)
获取doby下的table
|
org.dom4j.Element |
tc(org.dom4j.Element parent,
org.anyline.entity.html.Td td) |
org.dom4j.Element |
tr(org.dom4j.Element parent,
org.anyline.entity.html.Tr tr) |
bookmarks, getDoc, getSrc, getText, getTextList, getTexts, index, placeholders, placeholders, placeholders, placeholders, removeContent, replace, setDoc, setSrcpublic void flush()
public void loadStyle(String html)
public org.dom4j.Element before(org.dom4j.Element element,
String html)
element - elementhtml - htmlpublic org.dom4j.Element before(org.dom4j.Element point,
org.dom4j.Element element)
public org.dom4j.Element before(org.dom4j.Element point,
Wtable table)
public org.dom4j.Element after(org.dom4j.Element point,
org.dom4j.Element element)
public org.dom4j.Element after(org.dom4j.Element point,
Wtable table)
public org.dom4j.Element after(org.dom4j.Element element,
String html)
element - elementhtml - htmlpublic org.dom4j.Element insert(org.dom4j.Element parent,
String html)
public org.dom4j.Element insert(int index,
org.dom4j.Element parent,
String html)
public org.dom4j.Element insert(org.dom4j.Element parent,
org.dom4j.Element element)
public org.dom4j.Element insert(org.dom4j.Element parent,
Wtable table)
public org.dom4j.Element insert(int index,
org.dom4j.Element parent,
org.dom4j.Element element)
public org.dom4j.Element insert(int index,
org.dom4j.Element parent,
Wtable table)
public org.dom4j.Element parent(String bookmark, String tag)
bookmark - 书签tag - 上一级标签名 如tblpublic org.dom4j.Element parent(String bookmark)
public List<Wtable> tables(boolean recursion)
recursion - 是否递归获取所有级别的table,正常情况下不需要,word中的tbl一般在src下的最顶级,除非有表格嵌套public void setOrient(org.dom4j.Element prev,
String orient)
public void insertPageBreak(org.dom4j.Element prev)
public static int index(org.dom4j.Element parent,
org.dom4j.Element element)
public org.dom4j.Element parent(org.dom4j.Element element,
String... tags)
public org.dom4j.Element pp(org.dom4j.Element element)
element - 当前节点public org.dom4j.Element p(org.dom4j.Element element)
public org.dom4j.Element table(org.dom4j.Element box,
org.dom4j.Element after,
org.dom4j.Element src)
public org.dom4j.Element tr(org.dom4j.Element parent,
org.anyline.entity.html.Tr tr)
public org.dom4j.Element tc(org.dom4j.Element parent,
org.anyline.entity.html.Td td)
public org.dom4j.Element prevStyle(org.dom4j.Element prev)
public org.dom4j.Element block(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element element,
Map<String,String> styles)
public org.dom4j.Element parseHtml(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element html,
Map<String,String> styles,
boolean copyPrevStyle)
parent - 上一级prev - 放在prev之后html - htmlstyles - 样式copyPrevStyle - 是否复制前一个标签的样式,在替换书签时需要用到,但在div中嵌套的span需要避免复制闰一个标签的样式public WDocument remove(org.dom4j.Element element)
public org.dom4j.Element parseHtml(org.dom4j.Element parent,
org.dom4j.Element prev,
org.dom4j.Element html,
Map<String,String> styles)
public org.dom4j.Element insert(org.dom4j.Element prev,
File file)
prev - 在prev元素之前插入file - 模板文件public void save()
public void save(Charset charset)
Copyright © 2023. All rights reserved.