The other trick is to have a simple test document and unzip it down to the raw xml so that you can see how the whole thing hangs together. That way, you can look to see the names of the elements in the xml markup and this can help a great deal if you do need to dig down into the xmlbeans layer. Furthermore, using an IDE (NetBeans, Eclipse, etc) that opens a list of member names when you place the dot operator after an object reference is a great help. This allows you to effectively dig around inside the xmlbeans layer objects for which there is little or no documentation.
After a little more digging, I think that I can safely say it is the client codes responsibility for incrementing the numbers. In the numbering xml markup, only the starting values are given for each level and there is no sign of the actual level number appearing in the document.xml markup. The basic approach I was adopting was to grab the numID and see if it had changed since the previous paragraph. If it had then this was a new list, if it had not then I needed to increment the numbering value for that list entry. Of course, this is sidestepping the question of how do you know which level you are dealing with in a multi-level list and it may well be that you need to step down into the xmlbeans layer to handle this as I could not see any indication of the numbering level at the XWPFParagraph. Maybe, this is in the CTP object or maybe it is necessary to dig deeper into the individual character runs to get at the numbering level. Will continue to play around when I can and let you know. Bullets should be easier to deal with I think as all we need to do is grab the character, no incrmenting numbers to worry about here. The character does seem to be encoded within the xml markup for the numbering scheme but I only had a very quick glance at this yesterday and need to experiment further. My feeling is that once parsing is cracked, creation should also be possible. It ought to be a matter of attaching the numbering to a paragraph, creating the numbering scheme if it does not already exist in the document. Anyway, this is a bridge to cross another day I think. Sorry for the long post. Yours Mark B -- View this message in context: http://apache-poi.1045710.n5.nabble.com/XWPF-Parsing-or-creating-bullet-points-numbered-lists-with-POI-3-8-tp5710800p5710828.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]
