Hello,

First of all I'm sorry if there is an answer to my question, I tried to find
one without any results. So, I'd like to ask some help with the following:
I'm writing a document parser, the docs are word 2003 (.doc) files. I'm
using HWPF, and I've run into a problem. I'm iterate over the paragraphs of
the doc (where range = hwpfDocu.getRange() and listTables =
hwpfDocu.getListTables()):

for (int i = 0; i < range.numParagraphs(); i++) {
   paragraph = range.getParagraph(i);
   if (paragraph.isInTable()) {
      
paragraphList.add(DocuTable.getDocuTable(range.getTable(range.getParagraph(i))));
       i += range.getTable(range.getParagraph(i)).numParagraphs() - 1;
   } else {
      ListData listData = listTables.getListData(paragraph.getIlfo());
      ListLevel[] listLevel = listData.getLevels();
      ListLevel level = listLevel[range.getParagraph(i).getIlvl()];
      ...

And at that point I have a NullPointerException, 'cause listTables contains
wierd key values:
-5, -2, 642323, and so... The code is fine with some other documents, but
this isn't the only one where I have this error. I need the following
information:
level.getNumberText()
'cause it's contains some valuable text.

I tried XWPF as well (with docx files), but in that case I don't know how to
retrieve the numbering information of a paragraph, especially the text part
(for example: Tag: XXXXXXXX, the "Tag:" part is custom numbering).

Any help would be really appreciated, and thanks in advance.

BR,
Alex K

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Help-with-XWPF-tp4284224p4284224.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to