/[papo]/gnue/reports/filters/SimpleTabulation/text.xsl
ViewVC logotype

Diff of /gnue/reports/filters/SimpleTabulation/text.xsl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by charlie, Mon Aug 26 21:15:14 2002 UTC revision 1.4 by styxman, Thu Nov 14 23:02:37 2002 UTC
# Line 6  Line 6 
6    version="1.0">    version="1.0">
7    
8  <xsl:output method="text" indent="no"/>  <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>&#009;</xsl:text>  
   </xsl:variable>  
9    
10    <xsl:variable name="newline"><xsl:text>&#10;</xsl:text></xsl:variable>
11    <xsl:variable name="space80"><xsl:text>                                                                               </xsl:text></xsl:variable>
12    <xsl:variable name="doubleline80"><xsl:text>===============================================================================</xsl:text></xsl:variable>
13    <xsl:variable name="simpleline80"><xsl:text>-------------------------------------------------------------------------------</xsl:text></xsl:variable>
14    
15    <xsl:value-of select="$tab"/>  <xsl:template match="/">
16    <xsl:text>=====================================================</xsl:text>    <xsl:call-template name="doReportTitle"/>
   <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"/>  
17    <xsl:for-each select="gnue:report-output/t:report/t:section">    <xsl:for-each select="gnue:report-output/t:report/t:section">
18      <xsl:value-of select="t:sectionTitle"/>      <xsl:call-template name="doSectionTitle"/>
   
19      <xsl:for-each select="t:table">      <xsl:for-each select="t:table">
20        
21        <xsl:for-each select="t:tablehead">        <xsl:for-each select="t:tablehead">
22          <xsl:for-each select="t:colhead">          <xsl:for-each select="t:colhead">
23            <xsl:value-of select="."/><xsl:value-of select="$tab"/>            <xsl:call-template name="doColhead">
24                <xsl:with-param name="colname"><xsl:value-of select="."/></xsl:with-param>
25                <xsl:with-param name="colwidth"><xsl:value-of select="@width"/></xsl:with-param>
26              </xsl:call-template>
27          </xsl:for-each>          </xsl:for-each>
28          <xsl:value-of select="$newline"/>          <xsl:value-of select="$newline"/>
29            <xsl:value-of select="$doubleline80"/>
30            <xsl:value-of select="$newline"/>
31        </xsl:for-each>        </xsl:for-each>
32          
33        <xsl:for-each select="t:row">        <xsl:for-each select="t:row">
34            <xsl:choose>
35            <xsl:when test="@type='subtotal'">
36              <xsl:value-of select="$simpleline80"/>
37              <xsl:value-of select="$newline"/>
38            </xsl:when>
39            </xsl:choose>
40          <xsl:for-each select="t:col">          <xsl:for-each select="t:col">
41            <xsl:value-of select="."/><xsl:value-of select="$tab"/>            <xsl:call-template name="doRows">
42                <xsl:with-param name="position"><xsl:value-of select="position()"/></xsl:with-param>
43                <xsl:with-param name="align"><xsl:value-of select="@align"/></xsl:with-param>
44                <xsl:with-param name="value"><xsl:value-of select="."/></xsl:with-param>
45              </xsl:call-template>
46          </xsl:for-each>          </xsl:for-each>
47          <xsl:value-of select="$newline"/>          <xsl:value-of select="$newline"/>
48            <xsl:choose>
49            <xsl:when test="@type='subtotal'">
50              <xsl:value-of select="$newline"/>
51            </xsl:when>
52            </xsl:choose>
53        </xsl:for-each>        </xsl:for-each>
54    
55      </xsl:for-each>      </xsl:for-each>
56    </xsl:for-each>    </xsl:for-each>
57  </xsl:template>  </xsl:template>
58    
59    
60    <xsl:template name ="doReportTitle">
61      <xsl:variable name='title' select="gnue:report-output/t:report/t:reportTitle"/>
62      <xsl:value-of select="substring($space80, 1, (80 - string-length($title)) div 2)"/>
63      <xsl:value-of select='$title'/>
64      <xsl:value-of select="$newline"/>
65      <xsl:value-of select="substring($space80, 1, (80 - string-length($title)) div 2)"/>
66      <xsl:value-of select="substring($doubleline80, 1, string-length($title))"/>
67      <xsl:value-of select="$newline"/>
68    </xsl:template>
69    
70    
71    <xsl:template name ="doSectionTitle">
72      <xsl:variable name='title'><xsl:apply-templates select="t:sectionTitle"/></xsl:variable>
73      <xsl:value-of select="substring($space80, 1, (80 - string-length($title)) div 2)"/>
74      <xsl:value-of select='$title'/>
75      <xsl:value-of select="$newline"/>
76      <xsl:value-of select="substring($space80, 1, (80 - string-length($title)) div 2)"/>
77      <xsl:value-of select="$newline"/>
78    </xsl:template>
79    
80    
81    <xsl:template name ="doColhead">
82      <xsl:param name="colname"></xsl:param>
83      <xsl:param name="colwidth"></xsl:param>
84      <xsl:choose>
85        <xsl:when test="@align='right'">
86          <xsl:value-of select="substring($space80, 1, $colwidth - string-length($colname))"/>
87          <xsl:value-of select="$colname"/>
88        </xsl:when>
89        <xsl:when test="@align='center'">
90          <xsl:value-of select="substring($space80, 1, ($colwidth - string-length($colname)) div 2)"/>
91          <xsl:value-of select="$colname"/>
92          <xsl:value-of select="substring($space80, 1, ($colwidth - string-length($colname)) div 2)"/>
93        </xsl:when>
94        <xsl:otherwise>
95          <xsl:value-of select="$colname"/>
96          <xsl:value-of select="substring($space80, 1, $colwidth - string-length($colname))"/>
97        </xsl:otherwise>
98      </xsl:choose>
99    </xsl:template>
100    
101    
102    <xsl:template name ="doRows">
103      <xsl:param name='position' select="position()"/>
104      <xsl:param name='align' select="@align"/>
105      <xsl:param name='value' select="."/>
106        <xsl:for-each select="/gnue:report-output/t:report/t:section/t:table/t:tablehead/t:colhead">
107        <xsl:choose>
108        <xsl:when test="position()=$position">
109          <xsl:variable name="colwidth"><xsl:value-of select="@width"/></xsl:variable>
110          <xsl:choose>
111            <xsl:when test="$align='right'">
112              <xsl:value-of select="substring($space80, 1, $colwidth - string-length($value))"/>
113              <xsl:value-of select="$value"/>
114            </xsl:when>
115            <xsl:when test="$align='center'">
116              <xsl:value-of select="substring($space80, 1, ($colwidth - string-length($value)) div 2)"/>
117              <xsl:value-of select="$value"/>
118              <xsl:value-of select="substring($space80, 1, ($colwidth - string-length($value)) div 2)"/>
119            </xsl:when>
120            <xsl:otherwise>
121              <xsl:value-of select="$value"/>
122              <xsl:value-of select="substring($space80, 1, $colwidth - string-length($value))"/>
123            </xsl:otherwise>
124          </xsl:choose>
125        </xsl:when>
126        </xsl:choose>
127      </xsl:for-each>
128    </xsl:template>
129    
130  </xsl:stylesheet>  </xsl:stylesheet>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26