I don't know of a straightforward way to do what you want for PDF output. I
have implemented something like it for a client (not available for
distribution), but it was pretty involved. I used four passes, including
post-processing of the XSL-FO.
It wouldn't be hard in HTML output, though. Since version 1.73.2, the class
attributes have been generated by applying templates in mode="class.value".
Class attributes appear on almost every div and span element, so they
provide good coverage. That template is executed for each element, and you
could customize it to respond to your document's attributes. Then a CSS
stylesheet responding to your special class values could apply the coloring.
For FO output, I think the stylesheets would need to be rewritten to include
a call to a stub template for inserting additional properties. But that
doesn't exist, and I'm not sure how extensive of a revision it would
require.
Bob Stayton
Sagehill Enterprises
[EMAIL PROTECTED]
----- Original Message -----
From: "Jeff Hooker" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, March 20, 2008 2:10 PM
Subject: [docbook-apps] Adding processing based on an attribute value
Hi all,
I'm using Docbook XSL 1.73.2 and FOP 0.93.
Is there any straightforward way of checking to see if every element in a
document has a specific attribute attached, and if, so adding some
additional attributes to its block or inline element in the FO output, and
doing this without having to rewrite vast stretches of the stylesheets?
The basic need is that in my current PDF output, my reviewers have no way of
knowing if the content they're viewing is aimed at a specific audience
(small parts of many documents are specific to certain suppliers or
customers), so I'd like to cycle through every element and add some styling
to the block or inline element (i.e. make it red) in the event that it is
audience-specific. So far I can't find any way of doing this that doesn't
involve a mass of element-level modifications, to the point where my
modification layer basically contains most of the FO stylesheets.
Am I overcomplicating this? Any advice on a more intelligent approach would
be appreciated.
Regards,
Jeff.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]