This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] Advice on marking up ulinks


Marc Baaden wrote:

But when I produce print output with ulink.show=1, the URLs are repeated
very often, which is annoying.

Is there a kind of middle way, eg having the proper links more or less
everywhere in the html output, but less frequently in the print output ?

You can customize stylesheets to output URL only on a first occurence of link. Try to add following template to your customization stylesheet:


<xsl:template match="ulink[preceding::ulink/@url=./@url]">
  <fo:basic-link xsl:use-attribute-sets="xref.properties">
    <xsl:attribute name="external-destination">
      <xsl:call-template name="fo-external-image">
        <xsl:with-param name="filename" select="@url"/>
      </xsl:call-template>
    </xsl:attribute>

    <xsl:choose>
      <xsl:when test="count(child::node())=0">
        <xsl:call-template name="hyphenate-url">
          <xsl:with-param name="url" select="@url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
	<xsl:apply-templates/>
      </xsl:otherwise>
    </xsl:choose>
  </fo:basic-link>

</xsl:template>

--
-----------------------------------------------------------------
  Jirka Kosek  	
  e-mail: jirka at kosek dot cz
  http://www.kosek.cz


--------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe at lists dot oasis-open dot org For additional commands, e-mail: docbook-apps-help at lists dot oasis-open dot org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]