Re: Help with filtering in com.elovirta.ooxml #conditional-processing


Jonathan Hanna
 

Hi Leigh,

I'd like to preface this by saying that I'm fairly new to DITA (~1 year experience), so my solution is definitely not the best :-). However, I have experience making customizations to the com.elovirta.ooxml over the past year, so maybe I can provide you with a good place to start.

As far as I know, flagging content is not currently supported in the plugin (although filtering is). As a workaround, you can create a custom document.xsl file that contains a custom XSLT rule to highlight content in Word. When running the plugin, you will need to set the document.xsl parameter to the file path of your custom document.xsl file.

To create the custom file:
  1. Make a copy of the document.xsl file provided with the plugin.
  2. The document.xsl file imports many .xsl files in the plugin. In the new document.xsl file, you will need to append plugin:com.elovirta.ooxml:docx/word/ to the href of each imported file. For example, change <xsl:import href="document.utils.xsl"/> to <xsl:import href="plugin:com.elovirta.ooxml:docx/word/document.utils.xsl"/>.
  3. In the new file, add the following XSLT to the end of the file:
    <xsl:template match="*[contains(@audience, 'optional')]" mode="inline-style">
        <w:highlight w:val="yellow"/>
    </xsl:template>


I've attached a custom document.xsl file as an example. There are obvious limitations to this method, such as associating the color yellow with the value of the audience attribute instead of the ditaval property. For example, if you changed the backcolor attribute to green in the ditaval file you would still see a yellow highlight in Word. If I knew how to select properties set in a ditaval file, that would be a much better solution. Hopefully the above at least provides a good start to a better solution.

Best Regards,
Jonathan

Join main@dita-users.groups.io to automatically receive all group messages.