Display shortdesc of target topic in imagemap

Questions about XML that are not covered by the other forums should go here.
Anne
Posts: 18
Joined: Wed Dec 05, 2018 2:48 pm

Display shortdesc of target topic in imagemap

Post by Anne » Thu May 23, 2019 12:47 pm

Hi,

I found a similar topic dated back to 2015:
post33485.html?hilit=imagemap%20shortdesc#p33485

Is there an easier solution in 2019?

Thanks,
Anne

Radu
Posts: 6450
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display shortdesc of target topic in imagemap

Post by Radu » Mon May 27, 2019 8:17 am

Hi Anne,

Sorry but as this is not a common request we do not have a parameter to enable such behavior. So an XSLT customization would indeed be needed for this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Anne
Posts: 18
Joined: Wed Dec 05, 2018 2:48 pm

Re: Display shortdesc of target topic in imagemap

Post by Anne » Mon May 27, 2019 12:50 pm

Hi Radu,

As suggested in the mentioned post, I modified the file ut-d.xsl with the following:
<xsl:variable name="alttext"><xsl:apply-templates select="*[contains(@class, ' topic/xref ')]/*[contains(@class, ' topic/desc ')]" mode="text-only"/></xsl:variable>

however this didn't seem to work. Is anything else needed?

Thanks,
Anne

Radu
Posts: 6450
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display shortdesc of target topic in imagemap

Post by Radu » Mon May 27, 2019 2:01 pm

Hi Ann,

On that older forum post my suggestion was about making changes to the XSLTs in the "org.dita.xhtml" plugin.
About 1-2 years ago our WebHelp started to be based on the "org.dita.html5" plugin which has similar XSLT stylesheets.
So you would either need to make a change in the stylesheets for the html5 plugin or create a new DITA OT plugin which adds an extension for the HTML5 publishing overriding that base XSLT template.

If you will not be able to make this work I can try to look again at the code, and maybe come up with such a plugin in a couple of days.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Anne
Posts: 18
Joined: Wed Dec 05, 2018 2:48 pm

Re: Display shortdesc of target topic in imagemap

Post by Anne » Mon May 27, 2019 3:00 pm

I made the same change to the file ut-d.xsl under the "org.dita.html5" plugin, namely \dita-ot\plugins\org.dita.html5\xsl\ut-d.xsl , and ran a DITA Map Webhelp responsive transform. Alas, the same result. Is this the right file?

Radu
Posts: 6450
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display shortdesc of target topic in imagemap

Post by Radu » Tue May 28, 2019 10:41 am

Hello Anne,

I created a DITA Open Toolkit plugin which should do what you want:

https://github.com/oxygenxml/dita-html- ... desc-links

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Anne
Posts: 18
Joined: Wed Dec 05, 2018 2:48 pm

Re: Display shortdesc of target topic in imagemap

Post by Anne » Tue May 28, 2019 11:57 am

Hi Radu,

First, thank you very much for taking time to create this plugin. Unfortunately, it didn't work for me.
Here's what I did:
1. Downloaded the project as ZIP.
2. Extracted the folder com.oxygenxml.shortdesc.imagemap to the \Oxygen\docs-dita-tools\dita-ot\plugins folder.
3. In Oxygen, ran the Run DITA-OT integrator. The build was successful.
4. Restarted Oxygen.
5. Ran a standard DITA Map Webhelp Responsive transform on my bookmap that includes a topic with an imagemap.
6. Checked the results: the tooltips on the image map still display the topic names rather than their shortdescs. :-(

Did I do anything wrong?

Thanks and regards,
Anne

Radu
Posts: 6450
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display shortdesc of target topic in imagemap

Post by Radu » Wed May 29, 2019 8:10 am

Hi Anne,

You seem to be doing all the right things.
I just tested the plugin again with the DITA OT 3.x bundled with Oxygen 21.1 and it works for me. I'm testing with a very basic image map which looks like this:

Code: Select all

            <imagemap>
                <image href="../../images/Iris_sanguinea.jpg" scale="50"/>
                <area>
                    <shape>rect</shape>
                    <coords>50, 50, 100, 100</coords>
                    <xref href="../care.dita"/>
                </area>
            </imagemap>
Do those target topics actually have the shortdesc added to them?
Do you produce WebHelp responsive using the same DITA OT to which you made changes? Is that custom DITA-OT set as the default used DITA-OT in the Oxygen Preferences->DITA page?
Can you maybe debug the "DITA-OT3.x\plugins\com.oxygenxml.shortdesc.imagemap\xhtml.xsl" stylesheet on your side? Add an xsl:message inside the xsl:template, then in the Preferences->"DITA / Logging" page check the "Show console output->Always" radio button, run the transformation and see if in the DITA OT console view at the bottom of the application your message appears...

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Anne
Posts: 18
Joined: Wed Dec 05, 2018 2:48 pm

Re: Display shortdesc of target topic in imagemap

Post by Anne » Wed May 29, 2019 9:56 am

Hi Radu,

I found that in my Oxygen Preferences->DITA page DITA-OT was selected as built-in. Once I switched it to the actual custom location and ran a transform, all the shortdescs appeared in tooltips.

Thanks again for your help and persistence!

All the best,
Anne

Post Reply