docbook-apps

  • 1.  different background-color in header table for different chapters

    Posted 10-14-2008 21:40
    Dear all,

    I produce one book with “DocBook” and “XSL”.

    There is one header on each page.
    In Chapter 1 the “header.table” has “background-color” red. In chapter two it should have “background-color” green. (“header.table” in different chapter should have different background-color.)

    I write the following code in “myStylesheet.xsl”.

    <xsl:attribute-set name="header.table.properties">
    <xsl:attribute name="background-color">red</xsl:attribute>
    </xsl:attribute-set>

    But how can I get “green” for chapter two?

    I copied the template “header.table” in my customized stylesheet. But I do not know how to customize it.

    Thanks for any help!

    Lily


    --
    GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
    http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196



  • 2.  Re: [docbook-apps] different background-color in header table for different chapters

    Posted 10-15-2008 10:01
      |   view attached
    Hello,

    you just need to make a test and set the color according to the chapter
    cardinality, something like:


    <xsl:attribute-set name="header.table.properties">
    <xsl:attribute name="background-color">
    <xsl:choose>
    <xsl:when test="preceding-sibling::chapter">green</xsl:when>
    <xsl:otherwise>red</xsl:otherwise>
    </xsl:choose>
    </xsl:attribute>
    </xsl:attribute-set>

    Camille.

    Lily Galle wrote:
    > Dear all,
    >
    > I produce one book with “DocBook” and “XSL”.
    >
    > There is one header on each page.
    > In Chapter 1 the “header.table” has “background-color” red. In chapter two it should have “background-color” green. (“header.table” in different chapter should have different background-color.)
    >
    > I write the following code in “myStylesheet.xsl”.
    >
    > <xsl:attribute-set name="header.table.properties">
    > <xsl:attribute name="background-color">red</xsl:attribute>
    > </xsl:attribute-set>
    >
    > But how can I get “green” for chapter two?
    >
    > I copied the template “header.table” in my customized stylesheet. But I do not know how to customize it.
    >
    > Thanks for any help!
    >
    > Lily
    >
    >
    >

    Attachment(s)

    vcf
    camille.vcf   333 B 1 version