Re: Formatting Color of Acronyms and Spelled Out Forms

Hussein Shafie <[email protected]> Wed, 19 Jul 2017 09:51:48 +0200
Newsgroups gmane.text.xml.xfc.general
Message-ID <[email protected]>
On 07/18/2017 08:42 PM, Julie McHam wrote:
>
> The acronyms and spelled out forms are interpreted beautifully by your software. However, they are outputting as a dark purplish blue, and I would prefer them to be black (even though they are links). I have tried adding the following to my customized stylesheet (which only contains some formatting changes to some elements), but there is no change to the color:
>
>      <xsl:attribute-set name="abbreviated-form">
>             <xsl:attribute name="color">#000000</xsl:attribute>
>             <xsl:attribute name="font-style">normal</xsl:attribute>
>             <xsl:attribute name="font-weight">normal</xsl:attribute>
>       </xsl:attribute-set>

This is the right way to do that.




>
> Is it possible to change the color of these links? If so, please explain how I can do that.
>

An abbreviated-form is currently translated to XSL-FO as follows:

---
<xsl:template match="*[contains(@class,' abbrev-d/abbreviated-form ')]">
   <fo:inline xsl:use-attribute-sets="abbreviated-form">
     <xsl:call-template name="commonAttributes"/>
     <xsl:call-template name="basicLink">
       <xsl:with-param name="href" select="string(@href)"/>
     </xsl:call-template>
   </fo:inline>
</xsl:template>
---

Hence another attribute-set called "link-style" (used by template 
"basicLink") overrides what's specified in your "abbreviated-form" 
attribute-set.

1) Please keep your "abbreviated-form" attribute-set as is.

2) Use a text or XML editor to add this template to your XSL customization:

---
<xsl:template match="*[contains(@class,' abbrev-d/abbreviated-form ')]">
   <xsl:choose>
     <xsl:when test="exists(@href)">
       <fo:basic-link
         xsl:use-attribute-sets="link-style abbreviated-form">
         <xsl:call-template name="linkDestination">
           <xsl:with-param name="href" select="string(@href)"/>
         </xsl:call-template>
         <xsl:call-template name="commonAttributes"/>
         <xsl:apply-templates/>
       </fo:basic-link>
     </xsl:when>

     <xsl:otherwise>
       <fo:inline xsl:use-attribute-sets="abbreviated-form">
         <xsl:call-template name="commonAttributes"/>
         <xsl:apply-templates/>
       </fo:inline>
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>
---

We'll try to improve this in the next version of XMLmind DITA Converter. 
(The same customization issue exists for element <term>.)



--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support