Background color in some /row/entry informaltable

95 Views Asked by At

XML XSLT

The problem I'm having is that when I export the XML file applying the stylesheets the syntax is correct, but it doesn't apply the background color to the cells of the informaltable.

The output method is and we are aplying "pdf" format to the final file (xmlns:fo).

Any ideas?

Thank you very much!.

We have tried to apply diferent codes and the result is always to obtain cells in white background color.

@MartinHonnen relevant code examples XSLT: <?xml version="1.0" encoding="UTF-8"?>
<?stylesheet-label Adasa's template for PDF and PostScript creation?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:d="http://docbook.org/ns/docbook"
                version="1.0">
<xsl:import href="docbook5-config:xsl/fo/docbook.xsl"/>
<xsl:output method="xml"/>

    <xsl:attribute-set name="table.table.properties">
      <xsl:attribute name="border-before-width.conditionality">retain</xsl:attribute>
      <xsl:attribute name="border-collapse">collapse</xsl:attribute>
    </xsl:attribute-set>
    
    <xsl:template match="informaltable[@role='blue-table']">
     <xsl:apply-templates mode="blue_table"/>
    </xsl:template>
    
    <xsl:template match="row/entry[1]/para" mode="blue_table">
      <xsl:attribute name="background-color">#0E2F48</xsl:attribute>
      <xsl:attribute name="color">#FF0000</xsl:attribute>
    </xsl:template>

Relevant code examples XML:

<?xml version="1.0" encoding="UTF-8"?>
<section version="5.1" xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:trans="http://docbook.org/ns/transclusion"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:m="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook">
  <title>Equipo de Trabajo</title>
       
  <para>A continuación se describen las funciones y responsabilidades para cada uno de los perfiles que aparecen en la descripción de medios.</para>

  <informaltable role="blue_table">
    <tgroup cols="2">
      <colspec colname="c1" colwidth="310*"/>
      <colspec colname="c2" colwidth="690*"/>

      <tbody>
        <row>
          <entry valign="middle">
            <para>Delegado del Contratista</para>
          </entry>
0

There are 0 best solutions below