Word to DITA Conversion Batch Converter Add-On Style Mapping
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 7
- Joined: Tue May 24, 2022 11:36 pm
Word to DITA Conversion Batch Converter Add-On Style Mapping
Hi,
Question: I am converting Word documents to DITA XML for work using the Batch Converter Add-On 4.0.0. Am I able to map Word styles to specific XML elements?
Additional Questions: Would there be a way to map a style to an element with a specific attribute, e.g. map a custom Word style "cool" --> <note type = "cool"></note>? I also do have my own XML document with mappings used previously with a different conversion system. Is there any way to import this?
What I have done so far: I know styles can be mapped to HTML elements, and I found the file containing the style mapping in oxygen-batch-converter-core-24.1-SNAPSHOT.jar by opening it with the Archive Browser. Is there a way for me to add a mapping from Word --> HTML, then add a mapping (somewhere) that takes the element made in the intermediary Word --> HTML step (in a Word --> DITA conversion) to convert that HTML element to an XML element of my choosing? I found some XSL files that appear to convert HTML (or XHTML) to XML in the same JAR file, but I am not well versed in XSL.
Thank you very much.
Question: I am converting Word documents to DITA XML for work using the Batch Converter Add-On 4.0.0. Am I able to map Word styles to specific XML elements?
Additional Questions: Would there be a way to map a style to an element with a specific attribute, e.g. map a custom Word style "cool" --> <note type = "cool"></note>? I also do have my own XML document with mappings used previously with a different conversion system. Is there any way to import this?
What I have done so far: I know styles can be mapped to HTML elements, and I found the file containing the style mapping in oxygen-batch-converter-core-24.1-SNAPSHOT.jar by opening it with the Archive Browser. Is there a way for me to add a mapping from Word --> HTML, then add a mapping (somewhere) that takes the element made in the intermediary Word --> HTML step (in a Word --> DITA conversion) to convert that HTML element to an XML element of my choosing? I found some XSL files that appear to convert HTML (or XHTML) to XML in the same JAR file, but I am not well versed in XSL.
Thank you very much.
-
- Site Admin
- Posts: 125
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Word to DITA Conversion Batch Converter Add-On Style Mapping
Post by Cosmin Duna »
Hello,
The "wordStyleMap.xml" file that you found in the "oxygen-batch-converter-core" jar contains the default configuration of the conversion. You don't need to modify it because these styles mapping can be set using the "Word styles mapping" option from the "Plugins / Batch Documents Converter" preferences page (You can open the preferences dialog by invoking "Options" > 'Preferences...').
Here you can find more information about this option: https://www.oxygenxml.com/doc/versions/ ... w5_vw4_3rb
As you said this option controls the first step of conversion (Word to HTML) and the HTML element that you configure should be handled by the next step (HTML to DITA). But if you want a certain DITA element you can do the following without modifying that complex XSL file that you found:
Best regards,
Cosmin
The "wordStyleMap.xml" file that you found in the "oxygen-batch-converter-core" jar contains the default configuration of the conversion. You don't need to modify it because these styles mapping can be set using the "Word styles mapping" option from the "Plugins / Batch Documents Converter" preferences page (You can open the preferences dialog by invoking "Options" > 'Preferences...').
Here you can find more information about this option: https://www.oxygenxml.com/doc/versions/ ... w5_vw4_3rb
As you said this option controls the first step of conversion (Word to HTML) and the HTML element that you configure should be handled by the next step (HTML to DITA). But if you want a certain DITA element you can do the following without modifying that complex XSL file that you found:
- Configure the first step (Word to HTML) using "Word styles mapping" option to create an element with a certain class attribute for your word style.
- In the second step, this 'class' attribute will be converted to the 'outputclass' DITA attribute.
- Create a custom refactoring operation (https://www.oxygenxml.com/doc/versions/ ... _operation) based on a simple xslt that will convert the element with the outputclass attribute to the element you want in the resulted DITA content
- Add the following row in the "Word styles mapping" table:
| p | cool | p.cool:fresh | - Unzip this archive batchConverter-refactoring.zipin the '{Oxygen_installation_directory}/refactoring' directory.
- Restart Oxygen.
- Convert the document.
- Execute the custom refactoring operation (named "Post-processing Batch Documents Converter") on the resulted dita documents (https://www.oxygenxml.com/doc/versions/ ... tools.html)
Best regards,
Cosmin
You do not have the required permissions to view the files attached to this post.
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service