/usr/share/abiword-3.0/xsltml/tables.xsl is in abiword-common 3.0.0-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | <?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:m="http://www.w3.org/1998/Math/MathML"
version='1.0'>
<!-- ====================================================================== -->
<!-- $Id: tables.xsl,v 1.5 2005/02/28 18:50:45 shade33 Exp $
This file is part of the XSLT MathML Library distribution.
See ./README or http://xsltml.sf.net for
copyright and other information -->
<!-- ====================================================================== -->
<xsl:template match="m:mtd[@columnspan]">
<xsl:text>\multicolumn{</xsl:text>
<xsl:value-of select="@columnspan"/>
<xsl:text>}{c}{</xsl:text>
<xsl:apply-templates/>
<xsl:text>}</xsl:text>
<xsl:if test="count(following-sibling::*)>0">
<xsl:text>& </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="m:mtd">
<xsl:if test="@columnalign='right' or @columnalign='center'">
<xsl:text>\hfill </xsl:text>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="@columnalign='left' or @columnalign='center'">
<xsl:text>\hfill </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="m:mtr">
<xsl:for-each select="*">
<xsl:apply-templates select="current()"/>
<xsl:if test="not(position()=last())">
<xsl:text>& </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="not(position()=last())">
<xsl:text>\\ </xsl:text>
<xsl:if test="../@rowlines">
<xsl:variable name="line">
<xsl:call-template name="getToken">
<xsl:with-param name="text" select="../@rowlines"/>
<xsl:with-param name="position" select="position()"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$line='solid'">
<xsl:text>\hline </xsl:text>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="m:mtable">
<xsl:text>\begin{array}{</xsl:text>
<xsl:if test="@frame='solid'">
<xsl:text>|</xsl:text>
</xsl:if>
<xsl:variable name="numbercols" select="count(./m:mtr[1]/*[not(@columnspan)])+sum(./m:mtr[1]/m:mtd/@columnspan)"/>
<xsl:choose>
<xsl:when test="@columnalign and @columnlines">
<xsl:call-template name="generateAlignString">
<xsl:with-param name="columnalignstring" select="@columnalign"/>
<xsl:with-param name="columnlinestring" select="@columnlines"/>
<xsl:with-param name="count" select="$numbercols"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@columnlines">
<xsl:call-template name="generateAlignString">
<xsl:with-param name="columnlinestring" select="@columnlines"/>
<xsl:with-param name="count" select="$numbercols"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="@columnalign">
<xsl:call-template name="generateAlignString">
<xsl:with-param name="columnalignstring" select="@columnalign"/>
<xsl:with-param name="count" select="$numbercols"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="generateAlignString">
<xsl:with-param name="count" select="$numbercols"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@frame='solid'">
<xsl:text>|</xsl:text>
</xsl:if>
<xsl:text>}</xsl:text>
<xsl:if test="@frame='solid'">
<xsl:text>\hline </xsl:text>
</xsl:if>
<xsl:apply-templates/>
<xsl:if test="@frame='solid'">
<xsl:text>\\ \hline</xsl:text>
</xsl:if>
<xsl:text>\end{array}</xsl:text>
</xsl:template>
<xsl:template name="colalign">
<xsl:param name="colalign"/>
<xsl:choose>
<xsl:when test="contains($colalign,' ')">
<xsl:value-of select="substring($colalign,1,1)"/>
<xsl:call-template name="colalign">
<xsl:with-param name="colalign" select="substring-after($colalign,' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($colalign,1,1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="generate-string">
<!-- template from XSLT Standard Library v1.1 -->
<xsl:param name="text"/>
<xsl:param name="count"/>
<xsl:choose>
<xsl:when test="string-length($text) = 0 or $count <= 0"/>
<xsl:otherwise>
<xsl:value-of select="$text"/>
<xsl:call-template name="generate-string">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="generateAlignString">
<xsl:param name="columnalignstring">center</xsl:param>
<xsl:param name="columnlinestring"/>
<xsl:param name="count"/>
<xsl:choose>
<xsl:when test="$count <= 0"/>
<xsl:otherwise>
<xsl:variable name="columnalign">
<xsl:call-template name="getToken">
<xsl:with-param name="text" select="$columnalignstring"/>
<xsl:with-param name="position" select="1"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="columnline">
<xsl:call-template name="getToken">
<xsl:with-param name="text" select="$columnlinestring"/>
<xsl:with-param name="position" select="1"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="substring($columnalign,1,1)"/>
<xsl:if test="$columnline='solid' and $count>1"><xsl:text>|</xsl:text></xsl:if>
<xsl:variable name="leftPartOrLastTokenA">
<xsl:choose>
<xsl:when test="substring-after($columnalignstring,' ')">
<xsl:value-of select="substring-after($columnalignstring,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$columnalignstring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="leftPartOrLastTokenB">
<xsl:choose>
<xsl:when test="substring-after($columnlinestring,' ')">
<xsl:value-of select="substring-after($columnlinestring,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$columnlinestring"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="generateAlignString">
<xsl:with-param name="columnalignstring" select="$leftPartOrLastTokenA"/>
<xsl:with-param name="columnlinestring" select="$leftPartOrLastTokenB"/>
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getToken">
<xsl:param name="text"/>
<xsl:param name="char" select="string(' ')"/>
<xsl:param name="position"/>
<xsl:choose>
<xsl:when test="$position = 1 or not(contains($text ,$char))">
<xsl:choose>
<xsl:when test="contains($text ,$char)">
<xsl:value-of select="substring-before($text,$char)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="contains($text ,$char) and $position > 1">
<xsl:variable name="last" select="substring-after($text,$char)"/>
<xsl:choose>
<xsl:when test="$position > 1">
<xsl:call-template name="getToken">
<xsl:with-param name="text" select="$last"/>
<xsl:with-param name="char" select="$char"/>
<xsl:with-param name="position" select="$position - 1"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|