This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Coloring body text portions
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Shakun Mahajan" <shakun at customercaresolutions dot com>, "DocBook App List" <docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 18 May 2004 15:59:41 -0700
- Subject: Re: [docbook-apps] Coloring body text portions
- References: <NHBBLGHHJKDFOICPGIMECEODCBAA.shakun@customercaresolutions.com>
Hi,
The approaches for HTML and PDF differ somewhat. For HTML output, it is
easier to export a class attribute on some HTML element and then write a CSS
stylesheet to apply styles such as color. A few elements like <phrase> and
<emphasis> can export their role attribute value as a class attribute if you
set the right stylesheet parameter. See this section for an example:
http://www.sagehill.net/docbookxsl/UsingCSS.html#CustomClass
For PDF output, there are no attribute-sets to do what you want. You
generally need to add templates that respond to a role attribute value in
your document. Here is an example:
<xsl:template match="literal[@role='reference']">
<fo:inline color="blue">
<xsl:apply-imports/>
</fo:inline>
</xsl:template>
Then any instance of <literal role="reference"> will appear in blue in your
output.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Shakun Mahajan" <shakun@customercaresolutions.com>
To: "DocBook App List" <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, May 12, 2004 2:55 PM
Subject: [docbook-apps] Coloring body text portions
> Hi all,
>
> I am trying to convert some documents to PDF and HTML by using docbook xml
> format. I have visited the link http://www.sagehill.net/docbookxsl/ to get
> some answers but somehow I don't seem to get this one solved.
>
> My original document has certain function names, variable names and some
> normal text etc colored to highlight the code samples and references in
the
> body text.
> I am trying to achieve the same thing using docBook XSL but I do not know
> which attribute-set should be used and how can the colors be changed ?
>
> Can someone please guide me.
>
> Regards,
>
> Shakun Mahajan
> Customer Care Inc.
> Office (925) 277-0696
> shakun@customercaresolutions.com
>
> PROPRIETARY INFORMATION
> The information contained herein is for use only by authorized
> employees/consultants of Customer Care Inc. and authorized customers of
> Customer Care Inc. and not for general distribution within or outside the
> respective companies.
>
>
>
> To unsubscribe from this list, send a post to
docbook-apps-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
>
>
>
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.