[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/reports filters/SimpleTabulation/text.xsl ...
From: |
Jan Ischebeck |
Subject: |
gnue/reports filters/SimpleTabulation/text.xsl ... |
Date: |
Thu, 08 Aug 2002 12:53:46 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jan Ischebeck <address@hidden> 02/08/08 12:53:46
Modified files:
reports/filters/SimpleTabulation: text.xsl
Added files:
reports/adapters/filters/4xslt: __init__.py Adapter.py
Log message:
* enhance text.xsl in SimpleTabulation [btami]
* add a 4xslt Adapter.py (which should be useful for win32 users,
because 4suite has prebuilt binaries) [btmai]
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/filters/SimpleTabulation/text.xsl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/filters/4xslt/__init__.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/reports/adapters/filters/4xslt/Adapter.py?rev=1.1
Patches:
Index: gnue/reports/filters/SimpleTabulation/text.xsl
diff -c gnue/reports/filters/SimpleTabulation/text.xsl:1.2
gnue/reports/filters/SimpleTabulation/text.xsl:1.3
*** gnue/reports/filters/SimpleTabulation/text.xsl:1.2 Fri Apr 12 16:56:53 2002
--- gnue/reports/filters/SimpleTabulation/text.xsl Thu Aug 8 12:53:46 2002
***************
*** 6,48 ****
version="1.0">
<xsl:output method="text" indent="no"/>
- <xsl:template match="/">
- <xsl:variable name="newline">
- <xsl:text>
- </xsl:text>
- </xsl:variable>
- <xsl:variable name="tab">
- <xsl:text>	</xsl:text>
- </xsl:variable>
! <xsl:value-of select="$tab"/>
! <xsl:text>=====================================================</xsl:text>
! <xsl:value-of select="$newline"/>
! <xsl:value-of select="$tab"/><xsl:value-of select="$tab"/>
! <xsl:value-of select="gnue:report-output/t:report/t:reportTitle" />
! <xsl:value-of select="$newline"/>
! <xsl:value-of select="$tab"/>
! <xsl:text>=====================================================</xsl:text>
! <xsl:value-of select="$newline"/>
! <xsl:value-of select="$newline"/>
<xsl:for-each select="gnue:report-output/t:report/t:section">
! <xsl:value-of select="t:sectionTitle"/>
!
<xsl:for-each select="t:table">
<xsl:for-each select="t:tablehead">
<xsl:for-each select="t:colhead">
! <xsl:value-of select="."/><xsl:value-of select="$tab"/>
</xsl:for-each>
<xsl:value-of select="$newline"/>
</xsl:for-each>
<xsl:for-each select="t:row">
<xsl:for-each select="t:col">
! <xsl:value-of select="."/><xsl:value-of select="$tab"/>
</xsl:for-each>
<xsl:value-of select="$newline"/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--- 6,130 ----
version="1.0">
<xsl:output method="text" indent="no"/>
+ <xsl:variable name="newline"><xsl:text> </xsl:text></xsl:variable>
+ <xsl:variable name="space80"><xsl:text>
</xsl:text></xsl:variable>
+ <xsl:variable
name="doubleline80"><xsl:text>===============================================================================</xsl:text></xsl:variable>
+ <xsl:variable
name="simpleline80"><xsl:text>-------------------------------------------------------------------------------</xsl:text></xsl:variable>
! <xsl:template match="/">
! <xsl:call-template name="doReportTitle"/>
<xsl:for-each select="gnue:report-output/t:report/t:section">
! <xsl:call-template name="doSectionTitle"/>
<xsl:for-each select="t:table">
+
<xsl:for-each select="t:tablehead">
<xsl:for-each select="t:colhead">
! <xsl:call-template name="doColhead">
! <xsl:with-param name="colname"><xsl:value-of
select="."/></xsl:with-param>
! <xsl:with-param name="colwidth"><xsl:value-of
select="@width"/></xsl:with-param>
! </xsl:call-template>
</xsl:for-each>
<xsl:value-of select="$newline"/>
+ <xsl:value-of select="$doubleline80"/>
+ <xsl:value-of select="$newline"/>
</xsl:for-each>
+
<xsl:for-each select="t:row">
+ <xsl:choose>
+ <xsl:when test="@type='subtotal'">
+ <xsl:value-of select="$simpleline80"/>
+ <xsl:value-of select="$newline"/>
+ </xsl:when>
+ </xsl:choose>
<xsl:for-each select="t:col">
! <xsl:call-template name="doRows">
! <xsl:with-param name="position"><xsl:value-of
select="position()"/></xsl:with-param>
! <xsl:with-param name="align"><xsl:value-of
select="@align"/></xsl:with-param>
! <xsl:with-param name="value"><xsl:value-of
select="."/></xsl:with-param>
! </xsl:call-template>
</xsl:for-each>
<xsl:value-of select="$newline"/>
+ <xsl:choose>
+ <xsl:when test="@type='subtotal'">
+ <xsl:value-of select="$newline"/>
+ </xsl:when>
+ </xsl:choose>
</xsl:for-each>
+
</xsl:for-each>
</xsl:for-each>
</xsl:template>
+
+
+ <xsl:template name ="doReportTitle">
+ <xsl:variable name='title'
select="gnue:report-output/t:report/t:reportTitle"/>
+ <xsl:value-of select="substring($space80, 1, (80 - string-length($title))
div 2)"/>
+ <xsl:value-of select='$title'/>
+ <xsl:value-of select="$newline"/>
+ <xsl:value-of select="substring($space80, 1, (80 - string-length($title))
div 2)"/>
+ <xsl:value-of select="substring($doubleline80, 1, string-length($title))"/>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+
+
+ <xsl:template name ="doSectionTitle">
+ <xsl:variable name='title'><xsl:apply-templates
select="t:sectionTitle"/></xsl:variable>
+ <xsl:value-of select="substring($space80, 1, (80 - string-length($title))
div 2)"/>
+ <xsl:value-of select='$title'/>
+ <xsl:value-of select="$newline"/>
+ <xsl:value-of select="substring($space80, 1, (80 - string-length($title))
div 2)"/>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+
+
+ <xsl:template name ="doColhead">
+ <xsl:param name="colname"></xsl:param>
+ <xsl:param name="colwidth"></xsl:param>
+ <xsl:choose>
+ <xsl:when test="@align='right'">
+ <xsl:value-of select="substring($space80, 1, $colwidth -
string-length($colname))"/>
+ <xsl:value-of select="$colname"/>
+ </xsl:when>
+ <xsl:when test="@align='center'">
+ <xsl:value-of select="substring($space80, 1, ($colwidth -
string-length($colname)) div 2)"/>
+ <xsl:value-of select="$colname"/>
+ <xsl:value-of select="substring($space80, 1, ($colwidth -
string-length($colname)) div 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$colname"/>
+ <xsl:value-of select="substring($space80, 1, $colwidth -
string-length($colname))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name ="doRows">
+ <xsl:param name='position' select="position()"/>
+ <xsl:param name='align' select="@align"/>
+ <xsl:param name='value' select="."/>
+ <xsl:for-each
select="/gnue:report-output/t:report/t:section/t:table/t:tablehead/t:colhead">
+ <xsl:choose>
+ <xsl:when test="position()=$position">
+ <xsl:variable name="colwidth"><xsl:value-of
select="@width"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$align='right'">
+ <xsl:value-of select="substring($space80, 1, $colwidth -
string-length($value))"/>
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:when test="$align='center'">
+ <xsl:value-of select="substring($space80, 1, ($colwidth -
string-length($value)) div 2)"/>
+ <xsl:value-of select="$value"/>
+ <xsl:value-of select="substring($space80, 1, ($colwidth -
string-length($value)) div 2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ <xsl:value-of select="substring($space80, 1, $colwidth -
string-length($value))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
</xsl:stylesheet>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/reports filters/SimpleTabulation/text.xsl ...,
Jan Ischebeck <=