S
S
Stepan Sidorov2020-12-10 15:30:47
Word
Stepan Sidorov, 2020-12-10 15:30:47

How to read bullet list from Docx (OpenXML)?

Hello.
I need to read lists from a docx file. I figured out how to do this using XML, it's enough to find a line <w:numIdin a paragraph in the form of XML.
Paragraph example

<w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml">
  <w:pPr>
    <w:pStyle w:val="Normal"/>
    <w:numPr>
      <w:ilvl w:val="0"/>
      <w:numId w:val="3"/>
    </w:numPr>
    <w:bidi w:val="0"/>
    <w:jc w:val="left"/>
    <w:rPr/>
  </w:pPr>
  <w:r>
    <w:rPr/>
    <w:t>numerate list</w:t>
  </w:r>
</w:p>

But how do I know if it's a list bullet or a numerate list?
There is no specific record of this in the paragraph.
Through the styles from the docx library that I use to read the Docx file, it is not possible to get the type of the list.
I think that style indexes are stored somewhere, but I don't know where and how to get them.
How to find list style?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question