Skip to content

Instantly share code, notes, and snippets.

@codyc4321
Created January 28, 2016 16:45
Show Gist options
  • Save codyc4321/d8b50adfb9fd1686355e to your computer and use it in GitHub Desktop.
Save codyc4321/d8b50adfb9fd1686355e to your computer and use it in GitHub Desktop.
trying to remove "Estimated" and the black line underneath
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "&#10;">
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" indent="yes" />
<xsl:template match="reportdata">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<fo:layout-master-set>
<fo:simple-page-master margin-right="0.97cm" margin-left="0.97cm" margin-bottom="0.5cm" margin-top="1.0cm" page-width="27.94cm" page-height="21.59cm" master-name="letter-landscape">
<xsl:choose>
<xsl:when test="header/estimate_lines">
<fo:region-body margin-bottom="1.0cm" margin-top="3.5cm"/>
<fo:region-before extent="4.0cm"/>
</xsl:when>
<xsl:otherwise>
<fo:region-body margin-bottom="1.0cm" margin-top="3.0cm"/>
<fo:region-before extent="3.5cm"/>
</xsl:otherwise>
</xsl:choose>
<fo:region-after extent="1.0cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="MyPage">
<fo:repeatable-page-master-reference master-reference="letter-landscape"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<xsl:apply-templates select="schedule_page" />
<xsl:apply-templates select="qdi_page" />
</fo:root>
</xsl:template>
<xsl:template match="estimate_lines">
<fo:table-row>
<fo:table-cell>
<fo:block />
</fo:table-cell>
<xsl:if test="@num_actual_cols > 0">
<fo:table-cell padding-right="4pt" margin-bottom="4pt" padding-bottom="4pt">
<xsl:attribute name="number-columns-spanned">
<xsl:value-of select="@num_actual_cols"/>
</xsl:attribute>
<fo:block text-align="center" padding-right="4pt" margin-right="4pt" margin-bottom="4pt" padding-bottom="4pt">
<xsl:attribute name="border-bottom-color">black</xsl:attribute>
<xsl:attribute name="border-bottom-width">0.7pt</xsl:attribute>
<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
Actual
</fo:block>
</fo:table-cell>
</xsl:if>
<fo:table-cell padding-left="4pt" margin-bottom="4pt" padding-bottom="4pt">
<xsl:attribute name="number-columns-spanned">
<xsl:value-of select="@num_est_cols"/>
</xsl:attribute>
<fo:block text-align="center" padding-left="4pt" margin-left="4pt" margin-bottom="4pt" padding-bottom="4pt">
<xsl:attribute name="border-bottom-color">black</xsl:attribute>
<xsl:attribute name="border-bottom-width">0.7pt</xsl:attribute>
<xsl:attribute name="border-bottom-style">solid</xsl:attribute>
Estimated
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="header">
<fo:table-row>
<fo:table-cell margin-bottom="8pt">
<xsl:attribute name="number-columns-spanned">
<xsl:value-of select="count(../schedule_page/columns/column) div 2"/>
</xsl:attribute>
<fo:block text-align="left"
font-family="TradeGothicCondensed"
font-size="24pt"
font-weight="bold">
<xsl:apply-templates select="text" />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right"
vertical-align="top"
margin-bottom="8pt">
<xsl:attribute name="number-columns-spanned">
<xsl:value-of select="count(../schedule_page/columns/column) div 2"/>
</xsl:attribute>
<fo:block vertical-align="top" margin-bottom="8pt" space-after="8pt">
<fo:external-graphic src="url(static/logo.jpg)" content-width="1.5in" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:apply-templates select="estimate_lines" />
<fo:table-row>
<xsl:apply-templates select="../schedule_page/columns/column" mode="header"/>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<xsl:attribute name="border-top-color">black</xsl:attribute>
<xsl:attribute name="border-top-width">0.7pt</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
<fo:block />
</fo:table-cell>
<xsl:apply-templates select="../schedule_page/columns/column" mode="blank_cols_first" />
</fo:table-row>
</xsl:template>
<xsl:template match="footer">
<fo:table-row>
<fo:table-cell>
<fo:block text-align="left"
font-size="8pt"
line-height="10pt">
<xsl:apply-templates select="text" />
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="right"
font-size="8pt"
font-family="TradeGothicCondensed"
line-height="10pt"
vertical-align="bottom">
Page
<fo:page-number/> /
<fo:page-number-citation ref-id="last-page"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="schedule_page">
<fo:page-sequence master-reference="MyPage">
<fo:static-content flow-name="xsl-region-before">
<fo:table table-layout="fixed" border-collapse="separate" font-family="TradeGothicCondensed" font-size="8pt">
<xsl:apply-templates select="./columns/column" mode="definition">
</xsl:apply-templates>
<fo:table-body>
<xsl:apply-templates select="../header">
</xsl:apply-templates>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:table table-layout="fixed" border-collapse="separate" font-family="TradeGothicCondensed" font-size="8pt" padding-top="0.1cm">
<fo:table-body>
<xsl:apply-templates select="../footer"/>
</fo:table-body>
</fo:table>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" border-collapse="separate" font-family="TradeGothicCondensed" font-size="8pt">
<xsl:apply-templates select="data" />
</fo:table>
</fo:flow>
</fo:page-sequence>
</xsl:template>
<xsl:template match="data">
<xsl:apply-templates select="../columns/column" mode="definition" />
<fo:table-body font-family="TradeGothicCondensed">
<fo:table-row>
<fo:table-cell>
<fo:block text-align="left"
font-family="TradeGothicCondensed"
font-size="14pt"
font-weight="bold">
<xsl:attribute name="number-columns-spanned">
<xsl:value-of select="count(column)"/>
</xsl:attribute>
<xsl:value-of select="../@name" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:apply-templates select="columns" mode="header" />
<xsl:apply-templates select="group[count(./fund) > 0]" />
</fo:table-body>
</xsl:template>
<xsl:template match="columns" mode="definition">
<xsl:apply-templates select="column" mode="definition" />
</xsl:template>
<xsl:template match="columns" mode="header">
<fo:table-row>
<xsl:apply-templates select="column" mode="header" />
</fo:table-row>
</xsl:template>
<xsl:template match="column" mode="definition">
<fo:table-column>
<xsl:attribute name="column-width">
<xsl:value-of select="@size" />
</xsl:attribute>
</fo:table-column>
</xsl:template>
<xsl:template match="column" mode="header">
<fo:table-cell
display-align="after"
vertical-align="bottom"
padding="0pt"
margin="0pt">
<xsl:if test="@background">
<xsl:attribute name="background-color">
<xsl:value-of select="@background"/>
</xsl:attribute>
</xsl:if>
<fo:block
text-align="right"
vertical-align="bottom"
linefeed-treatment="preserve"
white-space-collapse="false"
white-space-treatment="preserve"
padding="0pt"
margin="0pt"
padding-top="4pt"
margin-bottom="0pt"
padding-bottom="2pt">
<xsl:if test="position() = 1">
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:if>
<xsl:if test="@align">
<xsl:attribute name="text-align">
<xsl:value-of select="@align"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@margin">
<xsl:attribute name="margin-right">
<xsl:value-of select="@margin"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@font-weight">
<xsl:attribute name="font-weight">
<xsl:value-of select="@font-weight"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@name" />
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="column" mode="blank_cols">
<xsl:if test="position() != 1">
<fo:table-cell display-align="after" vertical-align="bottom">
<xsl:if test="@background">
<xsl:attribute name="background-color">
<xsl:value-of select="@background"/>
</xsl:attribute>
</xsl:if>
<fo:block>&#160;</fo:block>
</fo:table-cell>
</xsl:if>
</xsl:template>
<xsl:template match="column" mode="blank_cols_first">
<xsl:if test="position() != 1">
<fo:table-cell>
<xsl:attribute name="border-top-color">black</xsl:attribute>
<xsl:attribute name="border-top-width">0.7pt</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
<fo:block
space-before="0.7pt"
>
<xsl:if test="@background">
<xsl:attribute name="background-color">
<xsl:value-of select="@background"/>
</xsl:attribute></xsl:if>
&#160;</fo:block>
</fo:table-cell>
</xsl:if>
</xsl:template>
<xsl:template match="group">
<fo:table-row>
<fo:table-cell>
<fo:block font-weight="bold"
line-height="13pt">
<xsl:if test="position() = last()">
<fo:block id="last-page" />
</xsl:if>
<xsl:value-of select="@name" />
</fo:block>
</fo:table-cell>
<xsl:apply-templates select="../../columns/column" mode="blank_cols" />
</fo:table-row>
<xsl:apply-templates select="fund" />
</xsl:template>
<xsl:template match="fund">
<fo:table-row>
<fo:table-cell display-align="after">
<fo:block text-align="left"
vertical-align="top"
padding-left="3pt"
line-height="12pt">
<xsl:if test="position() = last()">
<xsl:attribute name="space-after">
8pt
</xsl:attribute>
</xsl:if>
<xsl:if test="((position() mod 2) = 1) and (position() > 2)">
<xsl:attribute name="border-top-width">0.4pt</xsl:attribute>
<xsl:attribute name="border-top-color">#E0E0E0</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
</xsl:if>
<xsl:value-of select="@name" />
</fo:block>
</fo:table-cell>
<xsl:apply-templates select="cell">
<xsl:with-param name="needs_underline" select="((position() mod 2) = 1) and (position() > 2)" />
</xsl:apply-templates>
</fo:table-row>
</xsl:template>
<xsl:template match="cell">
<xsl:param name="needs_underline"></xsl:param>
<fo:table-cell>
<xsl:if test="@background">
<xsl:attribute name="background-color">
<xsl:value-of select="@background"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$needs_underline">
<xsl:attribute name="border-top-width">0.4pt</xsl:attribute>
<xsl:attribute name="border-top-color">#E0E0E0</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
</xsl:if>
<fo:block text-align="right"
line-height="12pt"
margin-bottom="0.4pt">
<xsl:if test="@align">
<xsl:attribute name="text-align">
<xsl:value-of select="@align"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@margin">
<xsl:attribute name="margin-right">
<xsl:value-of select="@margin"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@font-weight">
<xsl:attribute name="font-weight">
<xsl:value-of select="@font-weight"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="@value" />
</fo:block>
</fo:table-cell>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment