Don't display shortdesc for PDF links

HeatherW
Posts: 8
Joined: Tue May 01, 2012 10:05 am

Don't display shortdesc for PDF links

Post by HeatherW » Wed May 02, 2012 4:26 am

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: 6398
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post by Radu » Wed May 02, 2012 11:55 am

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 » Thu May 03, 2012 3:41 am

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: 6398
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post by Radu » Thu May 03, 2012 10:46 am

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 » Fri May 04, 2012 3:17 am

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 » Wed Jul 25, 2012 12:51 am

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: 6398
Joined: Fri Jul 09, 2004 5:18 pm

Re: Don't display shortdesc for PDF links

Post by Radu » Wed Jul 25, 2012 8:18 am

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