Formatting olinks

In print, if you want to apply formatting styles to olinks, you can use the olink.properties attribute-set, introduced in version 1.66 of the stylesheet. See the section “Attribute sets” for general information on using attribute-sets.

Any attributes defined in this attribute-set are added to the fo:basic-link element in the output. Typically font changes and color changes are applied in this way. The optional document title and page citation information are not included inside the fo:basic-link, and so are not affected by the style attributes.

If you need a property value to be conditional, then you can add an xsl:choose statement to an attribute body. For example:

<xsl:attribute-set name="olink.properties">
  <xsl:attribute name="color">
    <xsl:choose>
      <xsl:when test="@xrefstyle = 'MainLink'">red</xsl:when>
      <xsl:otherwise>inherit</xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
</xsl:attribute-set>

In this example, if an olink has a named xrefstyle="MainLink", then it will appear in red. Be sure to include an xsl:otherwise clause so you don't create an empty property.

For HTML, each olink in the output has a class="olink" attribute on the anchor tag. That permits a CSS stylesheet to apply format styles to olinks.