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: RE: [docbook-apps] Typography for olinks


Found a work-around/solution, and one thing to watch out for.
Here's the revised xref.properties attribute set:

	<!-- This attribute set makes the title blue and the page citation black. -->
	<!-- Internal olinks use xref properties. -->
	 <xsl:attribute-set name="xref.properties">
		
	  <xsl:attribute name="color">
	    <xsl:choose>
	      <xsl:when test="self::olink">#1892FF</xsl:when>
	      <xsl:otherwise>black</xsl:otherwise>
	    </xsl:choose>
	  </xsl:attribute>
	  
	  <xsl:attribute name="font-weight">
	    <xsl:choose>
	      <xsl:when test="self::olink">bold</xsl:when>
	      <xsl:otherwise>normal</xsl:otherwise>
	    </xsl:choose>
	  </xsl:attribute>  
	  
	</xsl:attribute-set>

And here's the thing to watch out for (at least with FOP 0.20.5):

"The Complete Guide" chapter on customizing cross references (http://www.sagehill.net/docbookxsl/CustomXrefs.html#CustomXrefStyle) 
provides the following example:

<xsl:attribute-set name="xref.properties">
  <xsl:attribute name="color">
    <xsl:choose>
      <xsl:when test="self::ulink">blue</xsl:when>
      <xsl:otherwise>inherit</xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
</xsl:attribute-set>

But for me, with FOP 0.20.5, using the inherit keyword in the xsl:otherwise clause
results in an error message:
[ERROR] Error in color property value 'inherit': \
org.apache.fop.fo.expr.PropertyException: No conversion defined

So I hard-coded black as the default color.
Not a great solution, but it lets me move forward.
Regards,
-Robert
-----Original Message-----
From: Robert Hall [mailto:rhall@vocera.com]
Sent: Mon 9/26/2005 11:33 AM
To: Bob Stayton; docbook-apps@lists.oasis-open.org
Subject: [docbook-apps] Typography for olinks
 
Using the 9/25 snapshot (based on 1.69.1) 
The goal is to have cross-ref text styled like this:
See System Requirements on page 27.

where the title is bold and blue, while the page citation is in the
normal body font. 

I can do this using xrefs by customizing the page citation gentext and
adding the following (based on "Customizing cross reference typography"
http://www.sagehill.net/docbookxsl/CustomXrefs.html#CustomXrefStyle) to
my customization layer:

<xsl:template  match="chapter|section"  
               mode="insert.title.markup">
  <xsl:param name="purpose"/>
  <xsl:param name="xrefstyle"/>
  <xsl:param name="title"/>

  <xsl:choose>
    <xsl:when test="$purpose = 'xref'">
      <fo:inline font-weight="bold" color="#1892FF">
        <xsl:copy-of select="$title"/>
      </fo:inline>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy-of select="$title"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

With olinks, however, it seems to be an all or nothing proposition:
either both the title and page citation use the customized typography,
or they both come across in the normal body font. 

I tried customizing the xref.properties attribute set as follows
(because interal olinks are formatted like xrefs), but the formatting
was applied to the title (as desired) and to the page citation (not
desired):

<xsl:attribute-set name="xref.properties">
	<xsl:attribute name="color">#1892FF</xsl:attribute>
	<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>

I also tried  putting <xsl:when test="$purpose = 'olink'"> in the
template, but got both title and page citation in the normal body font. 

Using xsltproc and FOP 0.20.5, with insert.xref.page.number="yes" and
insert.olink.page.number="maybe"
Sample tags:
<xref linkend="SystemRequirements" /> <!-- Works as desired -->
<olink targetdoc="rg" targetptr="SystemRequirements" /> <!-- All or
nothing -->

What am I missing?
Thanks,
-Robert

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






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