Issue with styles in ooxml plugin

25 views
Skip to first unread message

Jonathan Hanna

unread,
Jan 28, 2020, 7:26:17 PM1/28/20
to DITA-OT Users
Hi all,

I am trying to transform DITA content to DOCX using the com.elovirta.ooxml plugin. While I have been successful getting output, I am having trouble with styles in the DOCX template file being applied to elements. I am currently using the default Normal.docx template file provided with the plugin and use Office 365 to open the files in Word.

I have had success with the following styles:
  • topic titles: the "Heading 1," "Heading 2," etc. styles were applied to the topic titles
  • highlighting domain elements: text that was tagged as bold, italic, and underlined in a topic was rendered as bold, italic, and underlined in the DOCX file
  • <ul> and <ol> were rendered as bulleted and numbered lists
The styles are not being applied to all other elements. Instead, it appears that the "Normal" style is being applied to block elements and "Body Text" to inline elements by default.

As an example of what styles I believe should be applied, consider the document.sw-d.xsl file which contains the following code:

If I understand this correctly, I would think that the "HTMLVariable" style in the DOCX template would be applied to the <varname> element and the "HTMLKeyboard" style would be applied to <userinput>. Instead the "Body Text" style gets applied to both elements.

Any tips on what I may be doing wrong or misunderstanding?

Thanks,
Jonathan Hanna

Toshihiko Makita

unread,
Jan 29, 2020, 11:42:15 AM1/29/20
to DITA-OT Users
Hi Jonathan,

> I am currently using the default Normal.docx template file provided with the plugin and use Office 365 to open the files in Word.
> If I understand this correctly, I would think that the "HTMLVariable" style in the DOCX template would be applied to the <varname> element and the "HTMLKeyboard" style would be applied to <userinput>. Instead the "Body Text" style gets applied to both elements.

This is because plug-in bundled Normal.docx does not contain both styles in it.
  1. Try open Normal.docx via Microsoft Word and add some paragraph. Then apply "HTML Variable", "HTML Keyboard" style for any portion.
  2. Then Microsoft Word will generate these styles in Normal.docx surely.
  3. Save and close Normal.docx.
After doing above, try your transform once again.

Also, if you are interested .docx output, try my plug-in.

Antenna House AH-WML plug-in

Regards,

-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 --------------------------------------------------*/




2020年1月29日水曜日 9時26分17秒 UTC+9 Jonathan Hanna:

Jonathan Hanna

unread,
Jan 29, 2020, 1:39:57 PM1/29/20
to DITA-OT Users
Hi Toshihiko,

Thank you for your advice. That worked perfectly!

Thank you also for providing the link to your plugin. I will try it as well.

Best Regards,
Jonathan Hanna
Reply all
Reply to author
Forward
0 new messages