Incorrect link text in DITA PDF2 transform

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ageery
Posts: 6
Joined: Mon Nov 24, 2008 7:05 pm

Incorrect link text in DITA PDF2 transform

Post by ageery »

I'm creating a PDF document from a ditamap using the PDF2 transform. In my document, I have internal/dita links of the form <xref href="...">this is a link</xref>. When I transform to HTML or PDF, the body of the xref tag is preserved as the link text. However, when I do a PDF2 transform, the title of the topic pointed to by the href attribute becomes the link text. Is there someway using the PDF2 transform to preserve the original link text?

Thanks
Andrew
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Incorrect link text in DITA PDF2 transform

Post by Radu »

Hi Andrew,

You should try setting a format attribute to the xref like:

Code: Select all


<xref href="garagetaskoverview.xml#taskconcept"
format="dita">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ageery
Posts: 6
Joined: Mon Nov 24, 2008 7:05 pm

Re: Incorrect link text in DITA PDF2 transform

Post by ageery »

Thanks for the reply, Radu. However, that does not seem to work.

Here's the xref:

...
<li>
<xref href="test.xml#123" format="dita">
Text1
</xref>
</li>
...

Here's the task it's linking to:

...
<task id="123">
<title>Text2<title>
...

The link text is changed from Text1 to Text2. If I change the "123" to something that doesn't exist (say, "456"), the link has the correct text but the link isn't active (since it points to something that doesn't exist).

Am I missing something? I was wondering if this was a bug in a PDF stylesheet since the links are created correctly for XHTML output.

Thanks again!
Andrew
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Incorrect link text in DITA PDF2 transform

Post by Radu »

Hi Andrew,

There seem to be problems when referring an ID with a numeric value.
For example, if the task ID is "abc" everything seems OK.
Do you receive any linkage error in your console for the task with the ID "123"?
Something like:

Code: Select all


Topic reference (href : #null) not found
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ageery
Posts: 6
Joined: Mon Nov 24, 2008 7:05 pm

Re: Incorrect link text in DITA PDF2 transform

Post by ageery »

Thanks for your help. I did try non-numeric ids but I still have the problem when performing a PDF2 transform: the title of the referenced topic is used as the text of the link rather than the provided link text.

Thanks
Andrew
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: Incorrect link text in DITA PDF2 transform

Post by Radu »

Hi Andrew,

In the OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/xsl/fo/links.xsl at line 177 you can replace the line:

Code: Select all

<xsl:variable name="element" select="key('key_anchor',$destination)[1]"/>
with:

Code: Select all

<xsl:variable name="element" select="text()"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply