jelovirt / com.elovirta.ooxml

DITA to Word plug-in
Apache License 2.0
22 stars 14 forks source link

Invalid word document generated for figure which contains a description #44

Open raducoravu opened 6 years ago

raducoravu commented 6 years ago

I'm attaching a DITA Map which refers to a concept file containing a "fig" with a "desc" inside it. Somehow the generated Word document is invalid. I tested also with the "develop" branch.

figWithDesc.zip

raducoravu commented 6 years ago

As a possible workaround in the "flatten.xsl" in all places where "topic/div" is mentioned we should also add "topic/desc".

raducoravu commented 6 years ago

My suggested fix is not OK, if implemented this kind of project (which has a "desc" inside an xref) would start generating invalid word documents: https://github.com/jelovirt/com.elovirta.ooxml/files/1512896/liWithPInside.zip

raducoravu commented 6 years ago

Basically the "desc" element is block when it is a child of table and fig but it is inline when it is a child of "link" and "xref"

raducoravu commented 6 years ago

So in the XSLT stylesheet "com.elovirta.ooxml/docx/word/document.utils.xsl "the functions "x:block-content" and "x:is-block" could add something like:

         or (contains($class, ' topic/desc ') and ($element/parent::table or $element/parent::fig))
raducoravu commented 6 years ago

👍 Reported also by Leigh White on DITA Users List: https://groups.yahoo.com/neo/groups/dita-users/conversations/topics/43927