Displaying ShortDesc of Xref Topics in Imagemap
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 90
- Joined: Tue Mar 31, 2015 10:43 pm
Displaying ShortDesc of Xref Topics in Imagemap
I am using the <imagemap> element to create linkable areas over an image to other topics. In my HTML output, when you hover-over the linkable areas, the <title> of the topics being cross referenced displays as hover text. I do not want to display the linked topic's <title> as hover text, I want to show the linked topic's <shortdesc>.
Is there a way to easily do this if you are not a person that codes? Below is some sample text.
Is there a way to easily do this if you are not a person that codes? Below is some sample text.
Code: Select all
<imagemap id="imagemap_vnj_5qy_gr">
<image href="../../images/workspace_vwt.png" id="image_tzj_wqy_gr"/>
<area class="+ topic/figgroup ut-d/area ">
<shape>rect</shape>
<coords>161, 251,278,278</coords>
<xref href="brow_model_c.dita#concept_u5d_z3c_zq"/>
</area>
</imagemap>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Displaying ShortDesc of Xref Topics in Imagemap
Hi,
You will probably need to make some XSLT customizations for this.
The XSLT stylesheet:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.xhtml/xsl/xslhtml/ut-d.xsl
has a template which matches the imagemap and generates HTML output from it:
You should also consider registering on the Yahoo Groups DITA Users List, it is a very good place where to ask DITA publishing customization questions.
which at some point computes the title which will be set on the HTML <a> element corresponding to the DITA xref:
and you would probably need to modify the alttext variable to take only the description from the xref link like:
Regards,
Radu
You will probably need to make some XSLT customizations for this.
The XSLT stylesheet:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.xhtml/xsl/xslhtml/ut-d.xsl
has a template which matches the imagemap and generates HTML output from it:
You should also consider registering on the Yahoo Groups DITA Users List, it is a very good place where to ask DITA publishing customization questions.
Code: Select all
<xsl:template match="*[contains(@class,' ut-d/imagemap ')]" name="topic.ut-d.image
...........
Code: Select all
<!-- create ALT text from XREF content-->
<!-- if no XREF content, use @HREF, & put out a warning -->
<xsl:choose>
<xsl:when test="*[contains(@class, ' topic/xref ')]">
<xsl:variable name="alttext"><xsl:apply-templates select="*[contains(@class, ' topic/xref ')]/*[contains(@class, ' topic/desc ')]" mode="text-only"/></xsl:variable>
<xsl:attribute name="alt"><xsl:value-of select="normalize-space($alttext)"/></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="normalize-space($alttext)"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="ditamsg:area-element-without-linktext"/>
</xsl:otherwise>
</xsl:choose>
Code: Select all
<xsl:variable name="alttext"><xsl:apply-templates select="*[contains(@class, ' topic/xref ')]/*[contains(@class, ' topic/desc ')]" mode="text-only"/></xsl:variable>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Displaying ShortDesc of Xref Topics in Imagemap
Hi,
When Oxygen is installed in the Program Files folder, Windows requires administrative privileges in order to modify any file in there.
So you would have several options:
1) Start the application you want to use to edit the XSLT (Oxygen for example) with administrative privileges. This is usually done by right clicking its executable file and choosing "Run as administrator".
2) Install Oxygen in a folder where you have full access rights for the current user and use it from there.
3) Copy the entire DITA Open Toolkit folder:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT
to a location where you have full access rights, make the modification there and then use that external DITA OT folder for publishing:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ta-ot.html
4) Perform option (3) but instead of directly modifying the XSLT stylesheet create a DITA Open Toolkit plugin which adds an XSLT customization for the XHTML output like:
http://blog.oxygenxml.com/2013/12/creat ... olkit.html
Hope this helps,
Regards,
Radu
When Oxygen is installed in the Program Files folder, Windows requires administrative privileges in order to modify any file in there.
So you would have several options:
1) Start the application you want to use to edit the XSLT (Oxygen for example) with administrative privileges. This is usually done by right clicking its executable file and choosing "Run as administrator".
2) Install Oxygen in a folder where you have full access rights for the current user and use it from there.
3) Copy the entire DITA Open Toolkit folder:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT
to a location where you have full access rights, make the modification there and then use that external DITA OT folder for publishing:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ta-ot.html
4) Perform option (3) but instead of directly modifying the XSLT stylesheet create a DITA Open Toolkit plugin which adds an XSLT customization for the XHTML output like:
http://blog.oxygenxml.com/2013/12/creat ... olkit.html
Hope this helps,
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Displaying ShortDesc of Xref Topics in Imagemap
Hi,
Just to update this thread, there is now a DITA OT plugin on the Oxygen XML GitHub account which can be installed to do this:
https://github.com/oxygenxml/dita-html- ... desc-links
Regards,
Radu
Just to update this thread, there is now a DITA OT plugin on the Oxygen XML GitHub account which can be installed to do this:
https://github.com/oxygenxml/dita-html- ... desc-links
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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