Don't display shortdesc for PDF links

Post here questions and problems related to editing and publishing DITA content.
HeatherW
Posts: 8
Joined: Tue May 01, 2012 10:05 am

Don't display shortdesc for PDF links

Post 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
Radu
Posts: 9044
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HeatherW
Posts: 8
Joined: Tue May 01, 2012 10:05 am

Re: Don't display shortdesc for PDF links

Post 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
Radu
Posts: 9044
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HeatherW
Posts: 8
Joined: Tue May 01, 2012 10:05 am

Re: Don't display shortdesc for PDF links

Post 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
Janette
Posts: 4
Joined: Tue Jun 19, 2012 9:39 pm

Re: Don't display shortdesc for PDF links

Post 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!
Radu
Posts: 9044
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply