views:

180

answers:

2

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>";
                }
A: 

Hi, I tried this one but it is worked only for un-ordered list like bullets,ovel,circle.. I want to read an numbered formats like 1,2,3...I,II,III...A,b,C,, is it possible to read an ordered list items......

Thanks Jetti.

jetti
A: 

You thinking about it all wrong. It's not really a list nested within a list. It's a list with different list levels.

http://www.brandonrachal.com/?p=117

Brandon Rachal