|
|
|
@ -59,6 +59,7 @@ public class ReadWordTOC {
|
|
|
|
|
Element root = document.getRootElement();// 获取根元素
|
|
|
|
|
List<Element> children = root.element("body").elements("p");//工作区
|
|
|
|
|
boolean out = false;
|
|
|
|
|
boolean parent = false;
|
|
|
|
|
for (Element child : children) {
|
|
|
|
|
if (child.getName().equals("p")) {
|
|
|
|
|
List<Element> pChildren = child.elements();
|
|
|
|
@ -89,11 +90,16 @@ public class ReadWordTOC {
|
|
|
|
|
out = true;
|
|
|
|
|
}
|
|
|
|
|
if (printDxList.contains(content.substring(0, 1))) {
|
|
|
|
|
if ((content.substring(0, 1).equals("四") || content.substring(0, 1).equals("五"))) {
|
|
|
|
|
parent = true;
|
|
|
|
|
} else {
|
|
|
|
|
parent = false;
|
|
|
|
|
}
|
|
|
|
|
out = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrKit.isBlank(content.trim())) continue;
|
|
|
|
|
if (out) {
|
|
|
|
|
if (out && parent) {
|
|
|
|
|
if (content.startsWith("(")) System.out.print("\t");
|
|
|
|
|
if (content.matches("^[0-9]+\\..*")) System.out.print("\t\t");
|
|
|
|
|
System.out.println(content);
|
|
|
|
|