atom feed5 messages in org.oasis-open.lists.docbookRE: [docbook] Highlighting complete a...
FromSent OnAttachments
Tobias Anstett [k15t.com]Mar 7, 2009 12:56 pm 
David CramerMar 8, 2009 2:39 pm 
Tobias Anstett [k15t.com]Mar 9, 2009 6:13 am 
David CramerMar 9, 2009 8:50 am 
Tobias Anstett [k15t.com]Mar 9, 2009 12:17 pm 
Subject:RE: [docbook] Highlighting complete areas in DocBook
From:David Cramer (dcra@motive.com)
Date:Mar 8, 2009 2:39:45 pm
List:org.oasis-open.lists.docbook

To avoid needing to customize tons of templates, I do the following for that situation. This allows us to add role="highlight" to any element and have it be highlighted yellow. This needs to be in a customization layer that imports the docbook xsls because it relies on doing an xsl:apply-imports:

For html (assuming you have something like .remark{ background: yellow; } in your css):

<xsl:template match="text()[ ancestor::*/@role = 'highlight' ] | xref[ ancestor::*/@role = 'highlight' ]" priority="10"><span class="remark"><xsl:apply-imports/></span></xsl:template>

And for fo:

<xsl:template match="text()[ ancestor::*/@role = 'highlight' ] | xref[ ancestor::*/@role = 'highlight' ]" priority="10"> <fo:inline xmlns:fo="http://www.w3.org/1999/XSL/Format" background-color="yellow"><xsl:apply-imports/></fo:inline> </xsl:template>

David

-----Original Message----- From: Tobias Anstett [k15t.com] [mailto:tob@k15t.com] Sent: Saturday, March 07, 2009 2:57 PM To: docb@lists.oasis-open.org Subject: [docbook] Highlighting complete areas in DocBook

Hi together,

is there a way to highlight docbook elements in a generic way? I'd like to be able to put some extra attribute or pi to any docbook element to highlight it e.g. set the background color of a para (resulting fo:block) to red for PDF output. I already had a look at the change highlighting documented at http://www.sagehill.net/docbookxsl/Changebars.html, but because i am using Apache FOP i need some other mechanism to highlight docbook elements (and it childs) ranging from para, admonition, programmlistings, table, etc. to table.

Cheers, Tobias