Search code examples
xsltapache-fop

Is it possible to give background-color a variable value?


Is it possible to give background-color a variable value?

    <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt"
    space-after.optimum="3pt"  **background-color= "$bg_color"** color="black" text-align="left"
    padding-top="3pt">

Solution

  • I am guessing (!) you want to do:

    background-color= "{$bg_color}"
    

    See: http://www.w3.org/TR/xslt/#dt-attribute-value-template