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] Creating Styles for an Attribute

Hi Beth,

There is a technique that will conditionally add color to literal text regardless of its element.  Something like this:

<xsl:template match="text()[ancestor::*[@doc = 'FAT']]">
  <fo:inline color="red">

and similar templates for other attribute values and colors.

This matches on any text() node if it has an ancestor element matching your attribute value, and wraps that text in an <fo:inline> to color it.  It does not interfere in how each element is otherwise handled because it only operates on text nodes.

It's main limitation is that it only is applied to text nodes in your XML document, and so would not color generated text (like "Note" or xrefs) or any rule lines.  If you can live with that limitation then this is a simple solution.

Bob Stayton
On 9/10/2021 12:19 PM, Beth Van Wie wrote:



I’m trying to customize the Docbook stylesheets so my profiling attributes will produce colored text when I build the document without profiling. I currently have stylesheets that pull out the profiled information as needed, and I want to create a new stylesheet that uses the same attributes, does not profile, and colors the profiled sections.


I currently use the attribute doc=”” to profile my documents.


For example:


<para doc=”FAT”> </para>

<step doc=”SAT”> </step>


I commonly profile the following elements: para, row, step, procedure, section, table, figure, lists (different kinds of lists), and others.


I was able to write a stylesheet that would do this for a para element, and for a para element inside a step element, but the way I am doing it, I will have to write a new template for each element. Is there a way I can write one template to cover every time I use doc=””?


Thank you,





Sent from Mail for Windows


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