[ 
https://issues.apache.org/jira/browse/TIKA-2781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16686491#comment-16686491
 ] 

Madhav Bhagat commented on TIKA-2781:
-------------------------------------

[[email protected]] - Question for you: I am not getting right numbering for 
nested heading numberings. Since you are the master of the numbering code I was 
wondering if you can clarify a couple of things for me.

To set the stage:

Input in word looks like:
 # Heading 1
 # Heading 1 number 2
 ## Heading 2
 ## Heading 2 number 2

Output looks like:
 1. Heading 1
 2. Heading 1 number 2
 1. Heading 2
 1. Heading 2 number 2

The document.xml for (both) Heading 2s has numPr set as follows:
{code:xml}
<w:numPr>
  <w:ilvl w:val="0"/>
  <w:numId w:val="6"/>
</w:numPr>
{code}
And the relevant numbering.xml part looks like:
{code:xml}
    <w:num w:numId="6">
        <w:abstractNumId w:val="1"/>
        <w:lvlOverride w:ilvl="0">
            <w:startOverride w:val="1"/>
        </w:lvlOverride>
    </w:num>
{code}

- Now when generating the numbering, format string is {{%0.}} (*Q1*- not sure 
if this is right, might be)
- Further it looks like the {{buildTuple}} in {{XWPFListManager}} generates a 
tuple with {{start = 0}} even for the second item (Heading 2 number 2). Now I 
am not sure if this is correct. I am going to try to make start take the 
{{startOverride}} as defined above but doubt that will work.

Any help you can provide understanding this situation will be great. Thanks!

PS I have attached the docx file that is blowing up for your reference.

> Numbering is removed from headings when converting docx
> -------------------------------------------------------
>
>                 Key: TIKA-2781
>                 URL: https://issues.apache.org/jira/browse/TIKA-2781
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.19.1
>            Reporter: Madhav Bhagat
>            Priority: Minor
>         Attachments: Test-Numbering-MultipleLevels.docx, test numbering 
> (1).docx
>
>
> When converting a docx file with numbering in headings, TIKA ignores said 
> numbering and only returns the text. We have are investigating and working on 
> a fix (along with a test) and wanted to know if this is going to be accepted.
> Example of failing test file is attached.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to