docbook-apps

  • 1.  Changing Text Color

    Posted 01-30-2008 19:53
    For print output, how do I change the text in a draft section to be a
    different color than text in a final section? For example:


    <para>When processed, this text should be red (or some other
    color).</para>


    <para>When processed, this text should be black.</para>


    Thanks,
    Dave



  • 2.  RE: [docbook-apps] Changing Text Color

    Posted 01-30-2008 20:08
    You could do something like this:

    <xsl:template match="text()[ ancestor::*/@status = 'draft' ]| xref[
    ancestor::*/@status = 'final' ]">
    <fo:wrapper xmlns:fo="http://www.w3.org/1999/XSL/Format"
    color="blue"><xsl:apply-imports/></fo:wrapper>
    </xsl:template>

    If you're going to have final stuff nested in draft stuff, you may want
    to just match text()[ancestor::*@status] and then have a choose/when
    inside that. You can do the same thing with html output using spans and
    css.

    David

    >


  • 3.  RE: [docbook-apps] Changing Text Color

    Posted 01-30-2008 21:16
    Oops, make that:

    <xsl:template match="text()[ ancestor::*/@status = 'draft' ]| xref[
    ancestor::*/@status = 'draft' ]">
    <fo:wrapper xmlns:fo="http://www.w3.org/1999/XSL/Format"
    color="blue"><xsl:apply-imports/></fo:wrapper>
    </xsl:template>

    (I had ancestor::*/@status = 'final' rather than ancestor::*/@status =
    'draft' in the predicate to xref in my original post).

    David

    >