Page 1 of 1
Don't display shortdesc for PDF links
Posted: Wed May 02, 2012 4:26 am
by HeatherW
Hi,
When I use a reltable to create links between topics, the PDF output contains the shortdesc info after the link. I only want the link to display. Is there a way to disable shortdesc output for links in PDF?
Thanks in advance,
Heather
Re: Don't display shortdesc for PDF links
Posted: Wed May 02, 2012 11:55 am
by Radu
Hi Heather,
You have probably set the parameter
args.fo.include.rellinks to
all because by default rel links are not shown in the PDF output.
There does not seem to be a parameter to control the inclusion of the short description along with the link.
In the XSLT stylesheet:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/links.xsl
there is a template call:
Code: Select all
<xsl:call-template name="insertLinkShortDesc">....
which is responsible for inserting the link shortdesc.
You could try commenting it out or performing a customization which overwrites the template:
Code: Select all
<xsl:template match="*[contains(@class,' topic/link ')]" mode="processLink">...
and does not delegate to the shortdescription computation.
Regards,
Radu
Re: Don't display shortdesc for PDF links
Posted: Thu May 03, 2012 3:41 am
by HeatherW
Hi Radu,
Thanks for your help. I have args.fo.include.rellinks set to nofamily because I want the reltable links to display.
I tried commenting out the code you suggested, as follows:
<!-- <xsl:call-template name="insertLinkShortDesc">
<xsl:with-param name="destination" select="$destination"/>
<xsl:with-param name="element" select="$element"/>
<xsl:with-param name="linkScope" select="$linkScope"/>
</xsl:call-template> -->
But when I run the transform I get the following error:
[echo] Loading stylesheet /Users/heather/Downloads/oxygenAuthor/frameworks/dita/DITA-OT/demo/fo/xsl/fo/topic2fo_shell_1.0_fop.xsl
[java] Error at xsl:choose on line 54 column 21 of links.xsl:
[java] XTSE0010: Only xsl:when and xsl:otherwise are allowed within xsl:choose
[java] Failed to compile stylesheet. 1 error detected.
Have I missed something? I'm not sure what you mean by 'perform a customization', do I need to add the code you mention somewhere in links.xsl? I've searched the DITA Yahoo mailing list but I haven't found a solution.
Thanks
Heather
Re: Don't display shortdesc for PDF links
Posted: Thu May 03, 2012 10:46 am
by Radu
Hi Heather,
You correctly commented out the call template.
But from what the error looks like I think that you made one extra modification in the template:
Code: Select all
<xsl:template name="insertLinkShortDesc">
which made an
<xsl:choose> construct invalid so you should revert that change.
Regards,
Radu
Re: Don't display shortdesc for PDF links
Posted: Fri May 04, 2012 3:17 am
by HeatherW
Whoops! I reverted the change and now the PDF is publishing without the shortdesc for related links. Thanks for your help.
Cheers
Heather
Re: Don't display shortdesc for PDF links
Posted: Wed Jul 25, 2012 12:51 am
by Janette
Radu, I also want to comment out this template but because the template already contains comments, I get the error message that the string "--" is not permitted within comments.
What am I doing wrong as Heather obviously didn't run into this problem?
Thanks a lot!
Re: Don't display shortdesc for PDF links
Posted: Wed Jul 25, 2012 8:18 am
by Radu
Hi Janette,
Yes, the sequence "--" is not allowed in XML comments.
But if you select the entire content, right click and choose Toggle Comment the trick that Oxygen does is to also escape the "--" sequence to something like "-\-".
Afterwards you can use the same action to un-comment the commented-out fragment.
Regards,
Radu