Page 1 of 1

Incorrect link text in DITA PDF2 transform

Posted: Thu Jan 22, 2009 11:06 pm
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

Re: Incorrect link text in DITA PDF2 transform

Posted: Fri Jan 23, 2009 9:50 am
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

Re: Incorrect link text in DITA PDF2 transform

Posted: Fri Jan 23, 2009 5:33 pm
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

Re: Incorrect link text in DITA PDF2 transform

Posted: Mon Jan 26, 2009 9:44 am
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

Re: Incorrect link text in DITA PDF2 transform

Posted: Mon Jan 26, 2009 4:20 pm
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

Re: Incorrect link text in DITA PDF2 transform

Posted: Tue Jan 27, 2009 9:34 am
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