I am using docbook as a source for HTML and PDF output. In the docbook
source, I have a series of links which are relative (pointing to javadoc
files), which is fine for the HTML output because the javadoc files are
deployed alongside the original document. For the PDF output, I would like
to convert these to absolute links by way of prepending a URL prefix. Is
this possible? I have added a 'relative' role to these links and have tried
adding a fo customization layer:

<xsl:template match="d:link[@role='relative']">
  <xsl:copy>
    <xsl:attribute name="xlink:href">
      <xsl:value-of select="concat('http://prefix/', @xlink:href)"/>
    </xsl:attribute>
  </xsl:copy>
  <xsl:apply-templates select="d:link"/>
</xsl:template>

This seems to half-work in that it does prepend the prefix to the link
href, but then it does not convert the link element into FO.

Any ideas, or other ways this could be done?

Reply via email to