Numbering List Format is lost when get Tables from Document

With following code in Java, the Numbering List Format is lost. Where is no number before each paragraph.

-----Java Code-----
NodeCollection allTables = doc.getChildNodes(NodeType.TABLE, true);
String outputStr = tb.getFirstRow().getFirstCell().getParagraphs().get(0).getText();
-----Java Code end----

The output is " Acquire site and make available for Installation activities."
It should be : "1)Acquire site and make available for Installation activities. "

表格中含有章节号.zip (11.6 KB)

@tout,

Please try using the following code:

Document doc = new Document("E:\\191684\\in.docx");
doc.updateListLabels();

for (Paragraph para : (Iterable<Paragraph>) doc.getChildNodes(NodeType.PARAGRAPH, true)) {
    if (para.isListItem()) {
        System.out.println(para.toString(SaveFormat.TEXT));
    }
} 

Hope, this helps.

@awais.hafeez,

It’s really helpful. Thanks a lot!