OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Improving ulink fo rendering


These are two modifications I suggest: in FO XSL stylesheets:

1) make the url text an actual link
It is frustrating not to be able to click on a URL but only on the ulink text.
This can be done simply by moving down the fo:basic-link closing tag down in 
the <xsl:template match="ulink" name="ulink">

2) allow URL hyphenation on a custom list of characters.
This relies on adding of a new param:
  <xsl:param name="ulink.hyphenate.chars" select="':/@&amp;?.'"/>

and modification of the hyphenate-url template as follows:

  <xsl:template name="hyphenate-url">
    <xsl:param name="url" select="''"/>
      <xsl:when test="$ulink.hyphenate = ''">
        <xsl:value-of select="$url"/>
      <xsl:when test="not(string-length($url) = 1)">
        <xsl:variable name="char" select="substring($url, 0, 2)"/>
        <xsl:value-of select="$char"/>
        <xsl:if test="contains($ulink.hyphenate.chars,$char)">
          <xsl:copy-of select="$ulink.hyphenate"/>
        <xsl:call-template name="hyphenate-url">
          <xsl:with-param name="url" select="substring($url, 2, 1 div 0)"/>
        <xsl:value-of select="$url"/>

Camille Bégnis
NeoDoc Co-Founder

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]