Subversion Repositories bacoAlunos

Rev

Rev 1573 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.w3.org/1999/XSL/Format http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd">
    <xsl:param name="site">http://localhost/bacoTESTE</xsl:param>
    <xsl:param name="updateDate">EM FALTA</xsl:param>


    <xsl:variable name="STD_COLOR_SECTION">#FFEAAE</xsl:variable>
    <xsl:variable name="GREEN_COLOR_SECTION">#DDFCB1</xsl:variable>
    <xsl:variable name="BLUE_COLOR_SECTION">#B2E6FE</xsl:variable>
    <xsl:variable name="DIMENSION_COLOR_SECTION">#E29BD4</xsl:variable>
    <xsl:variable name="ROSE_COLOR_SECTION">#DF7480</xsl:variable>

    <xsl:variable name="STD_COLOR_SUB_SECTION">#D6D9BC</xsl:variable>
    <xsl:variable name="GREEN_COLOR_SUB_SECTION">#D0FCCD</xsl:variable>
    <xsl:variable name="BLUE_COLOR_SUB_SECTION">#CFF6FE</xsl:variable>
    <xsl:variable name="DIMENSION_COLOR_SUB_SECTION">#FFAFF0</xsl:variable>
    <xsl:variable name="ROSE_COLOR_SUB_SECTION">#FF9DA9</xsl:variable>

    <xsl:template name="indexEntry">
        <xsl:param name="id"></xsl:param>
        <xsl:param name="sectionNumber"></xsl:param>
        <xsl:param name="sectionTitle"></xsl:param>
        <xsl:param name="backgroundColorNumber">#FFCA44</xsl:param>
        <xsl:param name="colorNumber">white</xsl:param>
        <xsl:param name="borderNumber">1px solid #58585A</xsl:param>
        <xsl:param name="leaderPattern">dots</xsl:param>
        <fo:block font-size="12px" text-align-last="justify" margin-top="5px">
            <fo:basic-link internal-destination="{$id}">
                <fo:inline font-weight="bold"
                          padding-top="3px"
                          padding-bottom="2px"
                          padding-left="3px"
                          padding-right="3px"
                          margin-right="10px"
                          border-bottom="{$borderNumber}"
                          color="{$colorNumber}"
                          background-color="{$backgroundColorNumber}"><xsl:value-of select="$sectionNumber"/></fo:inline>
                <xsl:text> </xsl:text>
                <xsl:value-of select="$sectionTitle"/>
                <fo:leader leader-pattern="{$leaderPattern}" />
                <fo:page-number-citation ref-id="{$id}" />
            </fo:basic-link>
        </fo:block>
    </xsl:template>
    <xsl:template name="subIndexEntry">
        <xsl:param name="id"></xsl:param>
        <xsl:param name="sectionNumber"></xsl:param>
        <xsl:param name="sectionTitle"></xsl:param>
        <xsl:param name="backgroundColorNumber">white</xsl:param>
        <xsl:param name="colorNumber">black</xsl:param>
        <xsl:param name="borderNumber">0</xsl:param>
        <xsl:param name="leaderPattern">dots</xsl:param>
        <fo:block font-size="10px" text-align-last="justify" margin-top="5px" margin-left="20px" padding-left="20px">
            <fo:basic-link internal-destination="{$id}">
                <fo:inline font-weight="bold"
                          padding-top="3px"
                          padding-bottom="2px"
                          padding-left="3px"
                          padding-right="3px"
                          margin-right="10px"
                          border-bottom="{$borderNumber}"
                          color="{$colorNumber}"
                          background-color="{$backgroundColorNumber}">
                    <xsl:value-of select="$sectionNumber"/>
                </fo:inline>
                <xsl:text> </xsl:text>
                <xsl:value-of select="$sectionTitle"/>
                <fo:leader leader-pattern="{$leaderPattern}" />
                <fo:page-number-citation ref-id="{$id}" />
            </fo:basic-link>
        </fo:block>
    </xsl:template>

    <xsl:template name="headerIpp">
        <fo:static-content flow-name="header">
            <fo:block text-align="left">
                <fo:table width="100%" table-layout="fixed" border-bottom="1px solid black">
                    <fo:table-column column-width="100%"/>
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block>
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/layout/themes/ipp/logo.jpg')</xsl:variable>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="80" src="{$src}">
                                    </fo:external-graphic>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:block>
        </fo:static-content>
    </xsl:template>

    <xsl:template name="headerPae">
        <xsl:param name="color_entity">#fff9ea</xsl:param>
        <xsl:param name="entity">Joaquim José</xsl:param>
        <xsl:param name="title">Relatório de Avaliação Pedagógica</xsl:param>
        <xsl:param name="subtitle">Avaliação pelos alunos do docente:</xsl:param>
        <xsl:param name="subtitleRight">Resultados dos Inquéritos Pedagógicos</xsl:param>
        <xsl:param name="anoLectivo">000000</xsl:param>
        <fo:static-content  flow-name="header">
            <fo:block text-align="left" border-bottom="1px solid #58585A">
                <fo:table width="100%" table-layout="fixed" >
                    <fo:table-column column-width="80%"/>
                    <fo:table-column column-width="20%"/>
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block>
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/layout/themes/ipp/logo.jpg')</xsl:variable>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="40" src="{$src}">
                                    </fo:external-graphic>
                                </fo:block>
                                <fo:block font-size="10px" padding="0px" text-align="left">
                                    <fo:inline font-weight="bold"><xsl:value-of select="$title"/></fo:inline>
                                </fo:block>
                                <fo:block  font-size="10px" padding="0px" margin-top="0px" text-align="left" >
                                    <fo:inline><xsl:value-of select="$subtitle"/></fo:inline>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block font-size="10px" text-align="right" >
                                    <xsl:value-of select="$subtitleRight"/>
                                </fo:block>
                                <fo:block font-size="10px" padding="0px" margin-top="0px" text-align="right" >
                                    <fo:inline font-weight="bold">Ano letivo:</fo:inline> <xsl:value-of select="$anoLectivo"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                        <fo:table-row background-color="{$color_entity}">
                            <fo:table-cell>
                                <fo:block font-size="12px" padding="2px" margin-top="0px" >
                                    <fo:inline text-align="left"><xsl:value-of select="$entity"/></fo:inline>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block font-size="12px" padding="2px" margin-top="0px" text-align="right" >
                                    <fo:inline>Pagina: <fo:page-number/></fo:inline>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:block>
        </fo:static-content>
    </xsl:template>
    <xsl:template name="footerPae">
        <xsl:param name="sgqDoc">IPP.SI.QP-2-Rev.0</xsl:param>
        <xsl:param name="updateDate">EM FALTA</xsl:param>
        <fo:static-content flow-name="footer">
            <fo:table width="100%" table-layout="fixed" border-top="1px solid black" font-size="6.5pt">
                <fo:table-column column-width="20%"/>
                <fo:table-column column-width="80%"/>


                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell padding-top="3pt">
                            <fo:block>
                                Atualizado a
                                <xsl:value-of select="$updateDate"/> / Página
                                <fo:page-number/>
                            </fo:block>
                            <fo:block font-size="5pt">
                                <xsl:value-of select="$sgqDoc"/>
                            </fo:block>

                        </fo:table-cell>
                        <fo:table-cell padding-top="3pt">
                            <fo:block font-size="6pt" text-align="right">
                                http://pae.ipportalegre.pt | gerado pela plataforma ipp-pae® 2016
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:static-content>
    </xsl:template>

    <!-- SECCOES -->
    <xsl:template name="seccao">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="seccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$STD_COLOR_SECTION"/></xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="seccaoGreen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="seccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SECTION"/></xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="seccaoBlue">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="seccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SECTION"/></xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="seccaoDimension">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="seccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$DIMENSION_COLOR_SECTION"/></xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="seccaoRose">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="seccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SECTION"/></xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="seccaoGen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">0</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="backcolor"><xsl:value-of select="$STD_COLOR_SECTION"/></xsl:param>
        <fo:block padding="0" padding-left="0" margin="0" margin-top="{$marginTop}">
            <fo:table width="100%" table-layout="fixed" border="0" margin="0" padding="0">
                <fo:table-column column-width="90%"/>
                <fo:table-column column-width="10%"/>
                <fo:table-body>
                    <fo:table-row >
                        <fo:table-cell margin="0"
                                      padding="2px"
                                      background-color="{$backcolor}"
                                      display-align="center">
                            <fo:block
                                   font-size="12px"
                                   font-weight="bold"
                                   text-align="left"
                                   margin="0"
                                   padding="0">
                                <xsl:value-of select="$text"/>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell  margin="0" padding="0"  display-align="center" text-align="right" padding-right="5px">
                            <fo:block margin="0" padding="0">
                            <xsl:if test="$icon and $icon != ''">
                                <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/<xsl:value-of select="$icon"/>')</xsl:variable>
                                <fo:external-graphic height="auto"
                                                    width="auto"
                                                    margin="0"
                                                    padding="0"
                                                    content-height="20" src="{$src}"/>
                            </xsl:if>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </xsl:template>

    <!--SUB SECCOES-->
    <xsl:template name="subSeccao">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <xsl:call-template name="subSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$STD_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="textAlign" select="$textAlign"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSeccaoGreen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="textAlign" select="$textAlign"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSeccaoBlue">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="textAlign" select="$textAlign"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSeccaoDimension">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$DIMENSION_COLOR_SECTION"/></xsl:with-param>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="textAlign" select="$textAlign"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSeccaoRose">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="textAlign" select="$textAlign"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSeccaoGen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">8px</xsl:param>
        <xsl:param name="marginBottom">20px</xsl:param>
        <xsl:param name="backcolor"></xsl:param>
        <xsl:param name="marginLeft">10px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="columnIconSize">10%</xsl:param>
        <xsl:param name="fontSize">10px</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="textAlign">left</xsl:param>
        <fo:table width="100%" table-layout="fixed" border="0" margin="0" padding="0" margin-bottom="{$marginBottom}" margin-top="{$marginTop}" margin-left="{$marginLeft}">
            <fo:table-column/>
            <xsl:if test="$icon and $icon != ''">
                <fo:table-column column-width="{$columnIconSize}"/>
            </xsl:if>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell
                           padding="0"
                           padding-top="3px"
                           padding-bottom="3px"
                           padding-left="5px"
                           display-align="center"
                           margin="0">
                        <xsl:if test="$backcolor"><xsl:attribute name="background-color"><xsl:value-of select="$backcolor"/></xsl:attribute></xsl:if>
                        <fo:block
                               font-size="{$fontSize}"
                               font-weight="{$fontWeight}"
                               text-align="{$textAlign}"
                               margin="0" padding="0"
                               >
                            <xsl:value-of select="$text"/>
                        </fo:block>
                    </fo:table-cell>
                    <xsl:if test="$icon and $icon != ''">
                        <fo:table-cell margin="0" padding="0" padding-top="2px" display-align="center" text-align="right" padding-left="2px" padding-right="0">
                            <xsl:if test="$backcolor"><xsl:attribute name="background-color"><xsl:value-of select="$backcolor"/></xsl:attribute></xsl:if>
                            <fo:block margin="0" padding="0" display-align="center">
                                <xsl:if test="$icon and $icon != ''">
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/<xsl:value-of select="$icon"/>')</xsl:variable>
                                    <fo:external-graphic display-align="center" height="auto" width="auto"
                                                        content-height="15px" margin="0" padding="0" src="{$src}"/>
                                </xsl:if>
                            </fo:block>
                        </fo:table-cell>
                    </xsl:if>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </xsl:template>

    <!-- SUB SUB SECCOES -->
    <xsl:template name="subSubSeccao">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="marginBottom">5px</xsl:param>
        <xsl:call-template name="subSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$STD_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="fontSize" select="$fontSize"/>
            <xsl:with-param name="fontWeight" select="$fontWeight"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSeccaoBlue">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="marginBottom">5px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="fontSize" select="$fontSize"/>
            <xsl:with-param name="fontWeight" select="$fontWeight"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="icon" select="$icon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSeccaoGreen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="marginBottom">5px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="fontSize" select="$fontSize"/>
            <xsl:with-param name="fontWeight" select="$fontWeight"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="icon" select="$icon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSeccaoRose">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="marginBottom">5px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="fontSize" select="$fontSize"/>
            <xsl:with-param name="fontWeight" select="$fontWeight"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="marginBottom" select="$marginBottom"/>
            <xsl:with-param name="icon" select="$icon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSeccaoGen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="backcolor"></xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="fontWeight">normal</xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="marginBottom">5px</xsl:param>
        <xsl:param name="columnIconSize">5%</xsl:param>
        <xsl:param name="icon"></xsl:param>


        <fo:block margin-left="{$marginLeft}" margin-top="{$marginTop}" padding="0" padding-left="5px" margin="0" margin-bottom="{$marginBottom}">
            <fo:table width="100%" table-layout="fixed" border="0" margin="0" padding="0">
                <fo:table-column/>
                <xsl:if test="$icon and $icon != ''">
                    <fo:table-column column-width="{$columnIconSize}"/>
                </xsl:if>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell
                               padding="0"
                               display-align="center"
                               margin="0">
                            <xsl:if test="$backcolor"><xsl:attribute name="background-color"><xsl:value-of select="$backcolor"/></xsl:attribute></xsl:if>
                            <fo:block
                                   font-size="{$fontSize}"
                                   font-weight="{$fontWeight}"
                                   text-align="left"
                                   margin="0" padding="0"
                                   >
                                <xsl:value-of select="$text"/>
                            </fo:block>
                        </fo:table-cell>
                        <xsl:if test="$icon and $icon != ''">
                            <fo:table-cell margin="0" padding="0" display-align="center" text-align="right" padding-left="2px" padding-right="0">
                                <fo:block margin="0" padding="0" display-align="center">
                                    <xsl:if test="$icon and $icon != ''">
                                        <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/<xsl:value-of select="$icon"/>')</xsl:variable>

                                        <fo:external-graphic display-align="center" height="auto" width="auto"
                                                            content-height="15px" margin="0" padding="0" src="{$src}"/>
                                    </xsl:if>
                                </fo:block>
                            </fo:table-cell>
                        </xsl:if>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </xsl:template>

    <!--SUB SUB SUB SECCOES-->
    <xsl:template name="subSubSubSeccao">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="paddingRightBlock">30px</xsl:param>
        <xsl:param name="paddingRightIcon">5px</xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$STD_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="paddingRightBlock" select="$paddingRightBlock"/>
            <xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoBlue">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="paddingRightBlock">30px</xsl:param>
        <xsl:param name="paddingRightIcon">5px</xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="paddingRightBlock" select="$paddingRightBlock"/>
            <xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoGreen">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="paddingRightBlock">30px</xsl:param>
        <xsl:param name="paddingRightIcon">5px</xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="paddingRightBlock" select="$paddingRightBlock"/>
            <xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoRose">
        <xsl:param name="text"/>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="paddingRightBlock">30px</xsl:param>
        <xsl:param name="paddingRightIcon">5px</xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop" select="$marginTop"/>
            <xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft" select="$marginLeft"/>
            <xsl:with-param name="paddingRightBlock" select="$paddingRightBlock"/>
            <xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoGreenSmallSpaces">
        <xsl:param name="text"/>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop">1px</xsl:with-param>
            <xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft">0</xsl:with-param>
            <xsl:with-param name="paddingRightBlock">0</xsl:with-param>
            <xsl:with-param name="paddingRightIcon">0</xsl:with-param>
            <xsl:with-param name="marginBottomBlock">0</xsl:with-param>
            <xsl:with-param name="fontSize">6pt</xsl:with-param>
            <xsl:with-param name="iconVerticalAlign">before</xsl:with-param>
            <xsl:with-param name="iconWidth">8px</xsl:with-param>
            <xsl:with-param name="columnIconSize">10px</xsl:with-param>
            <xsl:with-param name="paddingLeftIcon">0</xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoBlueSmallSpaces">
        <xsl:param name="text"/>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="marginTop">1px</xsl:with-param>
            <xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SUB_SECTION"/></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft">0</xsl:with-param>
            <xsl:with-param name="paddingRightBlock">0</xsl:with-param>
            <xsl:with-param name="paddingRightIcon">0</xsl:with-param>
            <xsl:with-param name="marginBottomBlock">0</xsl:with-param>
            <xsl:with-param name="fontSize">6pt</xsl:with-param>
            <xsl:with-param name="iconVerticalAlign">before</xsl:with-param>
            <xsl:with-param name="iconWidth">8px</xsl:with-param>
            <xsl:with-param name="columnIconSize">10px</xsl:with-param>
            <xsl:with-param name="paddingLeftIcon">0</xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoSmallSpaces">
        <xsl:param name="text"/>
        <xsl:param name="subText"></xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:call-template name="subSubSubSeccaoGen">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="subText" select="$subText"/>
            <xsl:with-param name="marginTop">1px</xsl:with-param>
            <xsl:with-param name="backcolor"></xsl:with-param>
            <xsl:with-param name="icon" select="$icon"/>
            <xsl:with-param name="marginLeft">2px</xsl:with-param>
            <xsl:with-param name="paddingRightBlock">0</xsl:with-param>
            <xsl:with-param name="paddingRightIcon">0</xsl:with-param>
            <xsl:with-param name="marginBottomBlock">0</xsl:with-param>
            <xsl:with-param name="fontSize">6pt</xsl:with-param>
            <xsl:with-param name="iconVerticalAlign">before</xsl:with-param>
            <xsl:with-param name="iconWidth">8px</xsl:with-param>
            <xsl:with-param name="columnIconSize">10px</xsl:with-param>
            <xsl:with-param name="paddingLeftIcon">0</xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="subSubSubSeccaoGen">
        <xsl:param name="text"/>
        <xsl:param name="subText"></xsl:param>
        <xsl:param name="marginTop">2px</xsl:param>
        <xsl:param name="backcolor"></xsl:param>
        <xsl:param name="icon"></xsl:param>
        <xsl:param name="marginLeft">20px</xsl:param>
        <xsl:param name="paddingRightBlock">30px</xsl:param>
        <xsl:param name="paddingRightIcon">5px</xsl:param>
        <xsl:param name="paddingLeftIcon">5px</xsl:param>
        <xsl:param name="fontSize">8pt</xsl:param>
        <xsl:param name="marginBottomBlock">5px</xsl:param>
        <xsl:param name="iconVerticalAlign">center</xsl:param>
        <xsl:param name="iconWidth">15px</xsl:param>
        <xsl:param name="columnIconSize">5%</xsl:param>

        <fo:block margin-left="{$marginLeft}" margin-top="{$marginTop}" padding="0" padding-left="0" margin="0" margin-bottom="{$marginBottomBlock}" padding-right="{$paddingRightBlock}">
            <fo:table width="100%" table-layout="fixed" border="0" margin="0" padding="0">
                <fo:table-column column-width="{$columnIconSize}"/>
                <fo:table-column/>
                <fo:table-body>
                    <fo:table-row >

                        <fo:table-cell margin="0" padding="0" display-align="{$iconVerticalAlign}" text-align="right" padding-left="{$paddingLeftIcon}" padding-right="{$paddingRightIcon}">
                            <fo:block margin="0" padding="0" display-align="{$iconVerticalAlign}">
                                <xsl:if test="$icon and $icon != ''">
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/<xsl:value-of select="$icon"/>')</xsl:variable>
                                    <fo:external-graphic display-align="{$iconVerticalAlign}" height="auto" width="auto"
                                                        content-width="{$iconWidth}" margin="0" padding="0" src="{$src}"/>

                                </xsl:if>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell
                               padding="0"
                               display-align="center"
                               margin="0">
                            <xsl:if test="$backcolor"><xsl:attribute name="background-color"><xsl:value-of select="$backcolor"/></xsl:attribute></xsl:if>
                            <fo:block
                                   font-size="{$fontSize}"
                                   font-weight="bold"
                                   text-align="left"
                                   margin="0" padding="0"
                                   >
                                <xsl:value-of select="$text"/>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <xsl:if test="$subText">
                        <fo:table-row  >
                            <fo:table-cell
                                   number-columns-spanned="2"
                                   padding="0"
                                   display-align="center"
                                   margin="0">
                                <fo:block
                                       font-size="{$fontSize}"
                                       font-weight="bold"
                                       text-align="center"
                                       margin="0" padding="0"
                                       >
                                    <xsl:value-of select="$subText"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </xsl:if>

                </fo:table-body>
            </fo:table>
        </fo:block>
    </xsl:template>



    <!--FOLHA DE GRAFICOS POR PERGUNTA-->

    <xsl:template match="*" mode="graficosPerguntas">

            <xsl:choose>
                <xsl:when test="./chartsRow[1]/perguntaStats/perguntaStats">
                    <fo:block text-align="center" margin-left="10px">
                        <fo:table width="100%" table-layout="fixed">
                            <xsl:for-each select="./chartsRow[1]/perguntaStats/perguntaStats">
                                <fo:table-column/>
                            </xsl:for-each>
                            <fo:table-body>
                                <xsl:for-each select="./chartsRow">
                                    <fo:table-row>
                                        <xsl:for-each select="./perguntaStats/perguntaStats">
                                            <fo:table-cell>
                                                <fo:block>
                                                    <xsl:variable name="src">url('<xsl:value-of select="./tempFile"/>')</xsl:variable>
                                                    <fo:external-graphic
                                                           width="100%"
                                                           content-height="100%"
                                                           content-width="scale-to-fit"
                                                           scaling="uniform"
                                                           src="{$src}"/>
                                                </fo:block>
                                            </fo:table-cell>
                                        </xsl:for-each>
                                    </fo:table-row>
                                </xsl:for-each>
                            </fo:table-body>
                        </fo:table>
                    </fo:block>
                    <fo:block-container margin-top="20px">
                        <xsl:call-template name="legendaCoresPerguntas"/>
                    </fo:block-container>
                </xsl:when>
                <xsl:otherwise>
                    <fo:block text-align="center" margin-left="10px">Sem resultados para apresentar</fo:block>
                </xsl:otherwise>
            </xsl:choose>


    </xsl:template>

    <xsl:template name="legendaCoresPerguntas">
        <fo:block>
            <fo:table width="100%" table-layout="fixed" font-size="6.5pt" font-weight="normal">
                <fo:table-column column-width="50"/>
                <fo:table-column/>

                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell padding="2pt" number-columns-spanned="2">
                            <fo:block text-align="left" font-weight="bold">Legenda de Cores:</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell background-color="rgb(253, 11, 0)" padding="2pt">
                            <fo:block text-align="center">1</fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding="2pt" ><fo:block>O estudante avaliou a questão como Nada Satisfeito</fo:block></fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell background-color="rgb(255, 190, 0)" padding="2pt">
                            <fo:block text-align="center">2</fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding="2pt"><fo:block>O estudante avaliou a questão como Pouco Satisfeito</fo:block></fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell background-color="rgb(255, 254, 0)" padding="2pt">
                            <fo:block text-align="center">3</fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding="2pt"><fo:block>O estudante avaliou a questão Satisfeito</fo:block></fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell background-color="rgb(188, 255, 0)" padding="2pt">
                            <fo:block text-align="center">4</fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding="2pt"><fo:block>O estudante avaliou a questão bastante Satisfeito que corresponde a Bom</fo:block></fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell background-color="rgb(32, 255, 5)" padding="2pt">
                            <fo:block text-align="center">5</fo:block>
                        </fo:table-cell>
                        <fo:table-cell padding="2pt"><fo:block>O Estudante avaliou o docente com nota máxima de Muito Satisfeito</fo:block></fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </xsl:template>

    <!--FOLHA DE MEDIAS DE GRUPO-->

    <xsl:template match="*" mode="mediasGrupo">
        <xsl:param name="backgroundHeader"><xsl:value-of select="$backgroundHeader"/></xsl:param>
        <xsl:param name="backgroundFooter"><xsl:value-of select="$backgroundFooter"/></xsl:param>
        <xsl:param name="showSmile">true</xsl:param>
        <xsl:param name="objetoAvaliacao"/>
        <xsl:param name="smileHeight">30</xsl:param>
        <xsl:param name="fontSize">7pt</xsl:param>
        <xsl:param name="fontSizeMedias">10pt</xsl:param>
        <fo:block margin="0" padding="0">

            <fo:table width="100%" table-layout="fixed" font-size="{$fontSize}" font-weight="normal" margin="0" padding="0">
                <fo:table-column column-width="60%"/>
                <fo:table-column column-width="40%"/>
                <fo:table-body>

                    <fo:table-row>
                        <fo:table-cell margin="0" padding-left="0px" padding-right="5px" display-align="center">
                            <fo:block padding-left="0" padding="0" margin="0">
                                <xsl:apply-templates select="." mode="globalSmile">
                                    <xsl:with-param name="objetoAvaliacao" select="$objetoAvaliacao"/>
                                    <xsl:with-param name="backgroundHeader"><xsl:value-of select="$backgroundHeader"/></xsl:with-param>
                                    <xsl:with-param name="backgroundFooter"><xsl:value-of select="$backgroundFooter"/></xsl:with-param>
                                    <xsl:with-param name="showSmile" select="$showSmile"/>
                                    <xsl:with-param name="fontSize" select="$fontSize"/>
                                    <xsl:with-param name="fontSizeMedias" select="$fontSizeMedias"/>
                                    <xsl:with-param name="smileHeight" select="$smileHeight"/>
                                </xsl:apply-templates>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="after" text-align="center" padding-left="5px" padding-right="0">
                            <fo:block>
                                <xsl:apply-templates select="./mediasGlobaisTable" mode="DataTable">
                                    <xsl:with-param name="backgroundHeader"><xsl:value-of select="$backgroundHeader"/></xsl:with-param>
                                    <xsl:with-param name="backgroundFooter"><xsl:value-of select="$backgroundFooter"/></xsl:with-param>
                                    <xsl:with-param name="fontSize" select="$fontSize"/>
                                </xsl:apply-templates>
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>

        </fo:block>
    </xsl:template>

    <xsl:template match="*" mode="globalSmile">
        <xsl:param name="backgroundHeader"><xsl:value-of select="$backgroundHeader"/></xsl:param>
        <xsl:param name="backgroundFooter"><xsl:value-of select="$backgroundFooter"/></xsl:param>
        <xsl:param name="objetoAvaliacao"></xsl:param>
        <xsl:param name="smileHeight">30</xsl:param>
        <xsl:param name="fontSize">7pt</xsl:param>
        <xsl:param name="fontSizeMedias">10pt</xsl:param>
        <xsl:param name="showSmile">true</xsl:param>

            <fo:table width="100%" table-layout="auto" font-size="{$fontSize}" font-weight="normal">
                <fo:table-column column-width="30%"/>
                <fo:table-column/>
                <fo:table-column/>
                <fo:table-column/>
                <fo:table-column/>
                <fo:table-column/>
                <fo:table-body>
                    <xsl:if test="$showSmile = 'true'">
                        <fo:table-row>
                            <fo:table-cell text-align="center" >
                                <fo:block>

                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell text-align="center" >
                                <fo:block>
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/sad.png')</xsl:variable>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="{$smileHeight}" src="{$src}"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block></fo:block>
                            </fo:table-cell>
                            <fo:table-cell text-align="center" >
                                <fo:block>
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/indiferent.png')</xsl:variable>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="{$smileHeight}" src="{$src}"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell>
                                <fo:block></fo:block>
                            </fo:table-cell>
                            <fo:table-cell text-align="center" >
                                <fo:block>
                                    <xsl:variable name="src">url('<xsl:value-of select="$site"/>/imgs/questionarios/smile.png')</xsl:variable>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="{$smileHeight}" src="{$src}"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </xsl:if>
                    <fo:table-row border="2px solid black" font-size="{$fontSizeMedias}">
                        <fo:table-cell display-align="center" background-color="{$backgroundHeader}" text-align="center" padding="2px" border="2px solid black" font-size="{$fontSize}">
                            <fo:block>Avaliação média <xsl:value-of select="$objetoAvaliacao"/> em todas as questões</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" text-align="center" padding="4px" border="2px solid black">
                            <xsl:if test="./avaliacaoMediaArredondada=1">
                                <xsl:attribute name="background-color"><xsl:value-of select="./colorMedia"/></xsl:attribute>
                                <xsl:attribute name="font-weight">bold</xsl:attribute>
                            </xsl:if>
                            <fo:block>1</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" text-align="center" padding="4px" border="2px solid black">
                            <xsl:if test="./avaliacaoMediaArredondada=2">
                                <xsl:attribute name="background-color"><xsl:value-of select="./colorMedia"/></xsl:attribute>
                                <xsl:attribute name="font-weight">bold</xsl:attribute>
                            </xsl:if>
                            <fo:block>2</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" text-align="center" padding="4px" border="2px solid black">
                            <xsl:if test="./avaliacaoMediaArredondada=3">
                                <xsl:attribute name="background-color"><xsl:value-of select="./colorMedia"/></xsl:attribute>
                                <xsl:attribute name="font-weight">bold</xsl:attribute>
                            </xsl:if>
                            <fo:block>3</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" text-align="center" padding="4px" border="2px solid black">
                            <xsl:if test="./avaliacaoMediaArredondada=4">
                                <xsl:attribute name="background-color"><xsl:value-of select="./colorMedia"/></xsl:attribute>
                                <xsl:attribute name="font-weight">bold</xsl:attribute>
                            </xsl:if>
                            <fo:block>4</fo:block>
                        </fo:table-cell>
                        <fo:table-cell display-align="center" text-align="center" padding="4px" border="2px solid black">
                            <xsl:if test="./avaliacaoMediaArredondada=5">
                                <xsl:attribute name="background-color"><xsl:value-of select="./colorMedia"/></xsl:attribute>
                                <xsl:attribute name="font-weight">bold</xsl:attribute>
                            </xsl:if>
                            <fo:block>5</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
    </xsl:template>


    <!--PERCENTAGEMS COLUNAS-->

    <xsl:template name="barraPercentilDefinedProgress">
        <xsl:param name="valor"/>
        <xsl:param name="percentDefined"/>
        <xsl:call-template name="barraPercentilDefined">
            <xsl:with-param name="colors">progress</xsl:with-param>
            <xsl:with-param name="valor" select="$valor"/>
            <xsl:with-param name="percentDefined" select="$percentDefined"/>
            <xsl:with-param name="showPercentSimbol">false</xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="barraPercentilProgress">
        <xsl:param name="valor"/>
        <xsl:call-template name="barraPercentilDefined">
            <xsl:with-param name="colors">progress</xsl:with-param>
            <xsl:with-param name="valor" select="$valor"/>
            <xsl:with-param name="percentDefined" select="$valor"/>
            <xsl:with-param name="showPercentSimbol">true</xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="barraPercentil">
        <xsl:param name="valor"/>
        <xsl:param name="colors">false</xsl:param>
        <xsl:param name="backgroundColorPercentage"></xsl:param>
        <xsl:call-template name="barraPercentilDefined">
            <xsl:with-param name="colors" select="$colors"/>
            <xsl:with-param name="backgroundColorPercentage" select="$backgroundColorPercentage"/>
            <xsl:with-param name="valor" select="$valor"/>
            <xsl:with-param name="percentDefined" select="$valor"/>
            <xsl:with-param name="showPercentSimbol">true</xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="barraPercentilDefined">
        <xsl:param name="valor"></xsl:param>
        <xsl:param name="percentDefined"></xsl:param>
        <xsl:param name="colors">false</xsl:param>
        <xsl:param name="backgroundColorPercentage"></xsl:param>
        <xsl:param name="showPercentSimbol">false</xsl:param>


        <fo:block-container margin="1px" border="1px solid #C6C6CA" padding="0" padding-right="2px">
            <xsl:if test="$colors = 'progress'"><xsl:attribute name="background-color">#FD0B00</xsl:attribute></xsl:if>
            <fo:block-container border="1px solid #C6C6CA" margin="0" padding-top="1px" padding-bottom="0" margin-right="2px">
                <xsl:choose>
                    <xsl:when test="$colors = 'false'">
                        <xsl:attribute name="border">1px solid #8D7F5C</xsl:attribute>
                        <xsl:attribute name="background-color">#B9F1B1</xsl:attribute>
                    </xsl:when>
                    <xsl:when test="$colors = 'progress'">
                        <xsl:attribute name="border">1px solid #157C00</xsl:attribute>
                        <xsl:attribute name="background-color">#20FF05</xsl:attribute>
                        <xsl:if test="number(percentDefined) &lt; 10">
                            <xsl:attribute name="text-align">right</xsl:attribute>
                        </xsl:if>
                    </xsl:when>
                    <xsl:when test="$backgroundColorPercentage != ''">
                        <xsl:attribute name="background-color"><xsl:value-of select="$backgroundColorPercentage"/></xsl:attribute>
                        <xsl:choose>
                            <xsl:when test="$percentDefined &lt; 21">
                                <xsl:attribute name="border">1px solid #B10000</xsl:attribute>
                            </xsl:when>
                            <xsl:when test="$percentDefined &lt; 41">
                                <xsl:attribute name="border">1px solid #B85C00</xsl:attribute>
                            </xsl:when>
                            <xsl:when test="$percentDefined &lt; 61">
                                <xsl:attribute name="border">1px solid #868600</xsl:attribute>
                            </xsl:when>
                            <xsl:when test="$percentDefined &lt; 81">
                                <xsl:attribute name="border">1px solid #157C00</xsl:attribute>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:attribute name="border">1px solid #157C00</xsl:attribute>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:when>
                </xsl:choose>
                <xsl:attribute name="width"><xsl:value-of select="$percentDefined"/>%</xsl:attribute>
                <fo:block><xsl:value-of select="$valor"/><xsl:if test="$showPercentSimbol = 'true'">%</xsl:if> </fo:block>
            </fo:block-container>
        </fo:block-container>
    </xsl:template>



    <!--TABELA DE DADOS GENERICA-->
    <xsl:variable name="backgroundHeader"><xsl:value-of select="$STD_COLOR_SECTION"/></xsl:variable>
    <xsl:variable name="backgroundNormal">#FFFFFF</xsl:variable>
    <xsl:variable name="backgroundFooter"><xsl:value-of select="$STD_COLOR_SECTION"/></xsl:variable>
    <xsl:variable name="borderInHeader">2px solid black</xsl:variable>
    <xsl:variable name="borderInCell">1px dashed black</xsl:variable>
    <xsl:variable name="borderInFooter">2px solid black</xsl:variable>
    <xsl:variable name="borderInCellVertical">1px solid black</xsl:variable>
    <xsl:variable name="borderTable">2px solid black</xsl:variable>

    <xsl:template match="*" mode="DataTable">
        <xsl:param name="firstColPercentSize"></xsl:param>
        <xsl:param name="secondColPercentSize"></xsl:param>
        <xsl:param name="thirdColPercentSize"></xsl:param>
        <xsl:param name="fourthColPercentSize"></xsl:param>
        <xsl:param name="fifthColPercentSize"></xsl:param>
        <xsl:param name="sixthColPercentSize"></xsl:param>
        <xsl:param name="ignoreColumns">false</xsl:param>
        <xsl:param name="backgroundHeader"><xsl:value-of select="$backgroundHeader"/></xsl:param>
        <xsl:param name="backgroundFooter"><xsl:value-of select="$backgroundFooter"/></xsl:param>
        <xsl:param name="fontSize">7pt</xsl:param>


        <fo:table width="100%" table-layout="auto" font-size="{$fontSize}">
            <xsl:attribute name="border"><xsl:value-of select="$borderTable"/></xsl:attribute>

            <xsl:if test="$ignoreColumns = 'false'">
                <xsl:for-each select="./rows/row[1]/cols/col">
                    <xsl:choose>
                        <xsl:when test="$firstColPercentSize != '' and position() = 1">
                            <fo:table-column column-width="{$firstColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="$secondColPercentSize != '' and position() = 2">
                            <fo:table-column column-width="{$secondColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="$thirdColPercentSize != '' and position() = 3">
                            <fo:table-column column-width="{$thirdColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="$fourthColPercentSize != '' and position() = 4">
                            <fo:table-column column-width="{$fourthColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="$fifthColPercentSize != '' and position() = 5">
                            <fo:table-column column-width="{$fifthColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="$sixthColPercentSize != '' and position() = 6">
                            <fo:table-column column-width="{$sixthColPercentSize}"/>
                        </xsl:when>
                        <xsl:when test="width and width != ''">
                            <xsl:variable name="width" select="width"/>
                            <fo:table-column column-width="{$width}"/>
                        </xsl:when>
                        <xsl:otherwise><fo:table-column/></xsl:otherwise>
                    </xsl:choose>

                </xsl:for-each>
            </xsl:if>
            <fo:table-body>
                <xsl:for-each select="./rows/row[invisible = 'false']">
                    <xsl:variable name="rowPosition"><xsl:value-of select="position()"/></xsl:variable>
                    <xsl:variable name="lastRowPosition"><xsl:value-of select="last()"/></xsl:variable>
                    <fo:table-row background-color="{$backgroundHeader}">
                        <xsl:choose>
                            <xsl:when test="./type='header'"><xsl:attribute name="background-color"><xsl:value-of select="$backgroundHeader"/></xsl:attribute></xsl:when>
                            <xsl:when test="./type='normal'"><xsl:attribute name="background-color"><xsl:value-of select="$backgroundNormal"/></xsl:attribute></xsl:when>
                            <xsl:when test="./type='footer'"><xsl:attribute name="background-color"><xsl:value-of select="$backgroundFooter"/></xsl:attribute></xsl:when>
                        </xsl:choose>
                        <xsl:for-each select="./cols/col">
                            <xsl:choose>

                                <xsl:when test="./type='invisible'">
                                    <fo:table-cell border="0" background-color="#FFFFFF">
                                        <xsl:if test="number(colspan) &gt; 0"><xsl:attribute name="number-columns-spanned"><xsl:value-of select="colspan"/></xsl:attribute></xsl:if>
                                        <fo:block> </fo:block>
                                    </fo:table-cell>
                                </xsl:when>
                                <xsl:otherwise>
                                    <fo:table-cell padding="0" display-align="center">
                                        <xsl:if test="number(colspan) &gt; 0"><xsl:attribute name="number-columns-spanned"><xsl:value-of select="colspan"/></xsl:attribute></xsl:if>
                                        <xsl:if test="fontWeight = 'bold'"><xsl:attribute name="font-weight">bold</xsl:attribute></xsl:if>

                                        <xsl:if test="./backgroundColor != ''">
                                            <xsl:attribute name="background-color"><xsl:value-of select="./backgroundColor"/></xsl:attribute>
                                        </xsl:if>
                                        <xsl:choose>
                                            <xsl:when test="../../type='header'"><xsl:attribute name="border"><xsl:value-of select="$borderInHeader"/></xsl:attribute></xsl:when>
                                            <xsl:when test="../../type='normal'"><xsl:attribute name="border"><xsl:value-of select="$borderInCell"/></xsl:attribute></xsl:when>
                                            <xsl:when test="../../type='footer'"><xsl:attribute name="border"><xsl:value-of select="$borderInFooter"/></xsl:attribute></xsl:when>
                                        </xsl:choose>

                                        <xsl:choose>
                                            <xsl:when test="./align='left'"><xsl:attribute name="text-align">start</xsl:attribute></xsl:when>
                                            <xsl:when test="./align='right'"><xsl:attribute name="text-align">end</xsl:attribute></xsl:when>
                                            <xsl:when test="./align='center'"><xsl:attribute name="text-align">center</xsl:attribute></xsl:when>
                                        </xsl:choose>
                                        <xsl:if test="../../cols/col/type = 'percentage' and ./type != 'percentage'">
                                            <xsl:attribute name="padding-top">2px</xsl:attribute>
                                        </xsl:if>

                                        <xsl:if test="../../type='normal'">
                                            <xsl:if test="./type='label' and position()=1">
                                                <xsl:attribute name="border-right"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test="./type='label' and position()=last()">
                                                <xsl:attribute name="border-left"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test="../../../row[invisible='false'][$rowPosition+1]/type='normal'">
                                                <xsl:attribute name="border-bottom"><xsl:value-of select="$borderInCell"/></xsl:attribute>
                                            </xsl:if>
                                        </xsl:if>

                                        <xsl:if test="../../../row[invisible='false'][$rowPosition - 1]/type='header'">
                                            <xsl:attribute name="border-top"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
                                        </xsl:if>
                                        <xsl:if test="../../../row[invisible='false'][$rowPosition +1]/type='footer'">
                                            <xsl:attribute name="border-bottom"><xsl:value-of select="$borderInFooter"/></xsl:attribute>
                                        </xsl:if>
                                        <xsl:if test="../col[position() + 1 != last()]">
                                            <xsl:attribute name="border-right"><xsl:value-of select="$borderInCellVertical"/></xsl:attribute>
                                        </xsl:if>
                                        <fo:block-container margin="0" padding="0">
                                            <xsl:choose>
                                                <xsl:when test="./type='text'"><fo:block margin="0"  padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
                                                <xsl:when test="./type='number'"><fo:block margin="0"  padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
                                                <xsl:when test="./type='label'"><fo:block margin="0"  padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
                                                <xsl:when test="./type='percentage'">
                                                    <xsl:attribute name="text-align">left</xsl:attribute>
                                                    <xsl:attribute name="padding">0</xsl:attribute>
                                                    <xsl:call-template name="barraPercentil">
                                                        <xsl:with-param name="valor" select="./value"/>
                                                        <xsl:with-param name="colors" select="./usePercentageColor"/>
                                                        <xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
                                                    </xsl:call-template>
                                                </xsl:when>
                                                <xsl:when test="./type='percentageDefined'">
                                                    <xsl:attribute name="text-align">left</xsl:attribute>
                                                    <xsl:attribute name="padding">0</xsl:attribute>
                                                    <xsl:call-template name="barraPercentilDefined">
                                                        <xsl:with-param name="valor" select="./value"/>
                                                        <xsl:with-param name="percentDefined" select="./percentDefined"/>
                                                        <xsl:with-param name="colors" select="./usePercentageColor"/>
                                                        <xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
                                                    </xsl:call-template>
                                                </xsl:when>
                                                <xsl:when test="./type='percentageDefinedProgress'">
                                                    <xsl:attribute name="text-align">left</xsl:attribute>
                                                    <xsl:attribute name="padding">0</xsl:attribute>
                                                    <xsl:call-template name="barraPercentilDefinedProgress">
                                                        <xsl:with-param name="valor" select="./value"/>
                                                        <xsl:with-param name="percentDefined" select="./percentDefined"/>
                                                    </xsl:call-template>
                                                </xsl:when>
                                                <xsl:when test="./type='percentageProgress'">
                                                    <xsl:attribute name="text-align">left</xsl:attribute>
                                                    <xsl:attribute name="padding">0</xsl:attribute>
                                                    <xsl:call-template name="barraPercentilProgress">
                                                        <xsl:with-param name="valor" select="./value"/>
                                                    </xsl:call-template>
                                                </xsl:when>
                                            </xsl:choose>
                                        </fo:block-container>
                                    </fo:table-cell>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:for-each> <!-- Col -->
                    </fo:table-row>
                </xsl:for-each> <!--Row-->
            </fo:table-body>
        </fo:table>
    </xsl:template>


</xsl:stylesheet>