Apache POI HWPF Nested Lists?
Posted
by Mahadevan
on Stack Overflow
See other posts from Stack Overflow
or by Mahadevan
Published on 2010-01-29T12:47:12Z
Indexed on
2010/05/28
1:31 UTC
Read the original article
Hit count: 405
Hi,
I used the following code to read list structures from a word file using hwpf. My question is how to read a list structure that is nested ie a list within a list within a list and so on.
if (p instanceof ListEntry) {
ListEntry entry = (ListEntry) p;
outText = entry.text();
outText = "<li>" + outText + "</li>";
// verifca prima e ultimo
if (i > 1) {
pPrev = range.getParagraph(i - 1);
if (!(pPrev instanceof ListEntry))
outText = "<ul>" + outText;
}
if (i < nParagrafi - 1) {
pNext = range.getParagraph(i + 1);
if (!(pNext instanceof ListEntry))
outText = outText + "</ul>";
}
if (i == nParagrafi - 1) {
outText = outText + "</ul>";
}
© Stack Overflow or respective owner