Page 1 of 1
Batch Converter failures
Posted: Wed Aug 17, 2022 11:43 pm
by bburns_hpi
I'm trying to convert a Word doc using the Batch Conversion utility. Whether I use Word to DITA or Word to XHTML, I get the following error -
Duplicate key TableNum2 (attempted merging values org.zwobble.mammoth.internal.docx.Numbering$AbstractNumLevel@6cc52dc4 and org.zwobble.mammoth.internal.docx.Numbering$AbstractNumLevel@594dacd1)
Appears to be a problem with an autnumbering token, except none of the tables use autonumbering. Has anyone else encountered this error and found a workaround?
Re: Batch Converter failures
Posted: Thu Aug 18, 2022 12:15 pm
by Cosmin Duna
Hi,
The Word document has a document named "numbering.xml" in its internal structure used for labelling individual paragraphs with numbers, letters, and/or symbols. Somehow two w:lvl elements in this file have the same w:pStyle element and the add-on doesn't expect to find this case. I will add an internal issue to be more permissive to this structure.
These are the steps that you should do to fix the Word document:
- Make a copy of the Word document
- Open the Word document into the Archive Browser view from Oxygen
- Open the word/styles.xml file
- Format and indent this file
- Search for the "w:style" element that has the "TableNum2" value for the "w:styleId" attribute.
- Make a copy of this "w:style" element and change the w:styleId value with a new one. For example TableNum3. Make sure that id is unique
- Change the value from the 'w:val' attribute on w:name element too. For example 'TableNum 3'
- Save this file.
- Open the word/numbering.xml file
- Format and indent this file
- Search for the w:pStyle elements that have the 'TableNum2' value for the " w:val" attribute.
- You should find 2 elements with this value. Change the value of one of them with the one set at point 6.
- Save the file.
- Now you can convert the word document again.
Please, let me know if it works.
Best regards,
Cosmin
Re: Batch Converter failures
Posted: Tue Aug 30, 2022 4:34 pm
by bburns_hpi
Thanks, Cosmin. I ran across a few more duplicate styles, but repeating the process eventually gave me a usable Word doc.
Is there any way to map Word styles to specific markup?
Re: Batch Converter failures
Posted: Wed Aug 31, 2022 9:44 am
by Cosmin Duna
Hi,
Yes, the add-on has an option for mapping Word styles. Check this section from the documentation for more information:
https://www.oxygenxml.com/doc/versions/ ... w5_vw4_3rb
We also have a webinar where this migration from Word and this configuration is described:
https://youtu.be/RAH875CLUKw?t=425
Best regards,
Cosmin
Re: Batch Converter failures
Posted: Thu Sep 29, 2022 3:42 pm
by Cosmin Duna
Hi,
I just wanted to let you know that version 5.0.0 of the Batch Documents Converter add-on is out now and it contains a fix for the issue you reported on this thread. Now the converter should not report that error when finding those duplicate keys.
Best regards,
Cosmin