Batch Converter failures

Oxygen general issues.
bburns_hpi
Posts: 2
Joined: Wed Oct 13, 2021 6:27 pm

Batch Converter failures

Post 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?
Bill Burns
HP Inc.
Content & Taxonomy Enablement (CTE)
Cosmin Duna
Site Admin
Posts: 125
Joined: Wed Dec 12, 2018 5:33 pm

Re: Batch Converter failures

Post 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:
  1. Make a copy of the Word document
  2. Open the Word document into the Archive Browser view from Oxygen
  3. Open the word/styles.xml file
  4. Format and indent this file
  5. Search for the "w:style" element that has the "TableNum2" value for the "w:styleId" attribute.
  6. 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
  7. Change the value from the 'w:val' attribute on w:name element too. For example 'TableNum 3'
  8. Save this file.
  9. Open the word/numbering.xml file
  10. Format and indent this file
  11. Search for the w:pStyle elements that have the 'TableNum2' value for the " w:val" attribute.
  12. You should find 2 elements with this value. Change the value of one of them with the one set at point 6.
  13. Save the file.
  14. Now you can convert the word document again.
Please, let me know if it works.

Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
bburns_hpi
Posts: 2
Joined: Wed Oct 13, 2021 6:27 pm

Re: Batch Converter failures

Post 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?
Bill Burns
HP Inc.
Content & Taxonomy Enablement (CTE)
Cosmin Duna
Site Admin
Posts: 125
Joined: Wed Dec 12, 2018 5:33 pm

Re: Batch Converter failures

Post 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
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
Cosmin Duna
Site Admin
Posts: 125
Joined: Wed Dec 12, 2018 5:33 pm

Re: Batch Converter failures

Post 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
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply