+<!-- TODO: this needs parameters, but we need to determine which
+ - cols: number of cols?
+ - first: is first column special?
+
+ -->
+<xsl:template match="tabela">
+ <cmd name="outmulticols"></cmd>
+ <cmd name="begin"><parm>tabela</parm> </cmd>
+ <xsl:apply-templates mode="tabela"/>
+ <cmd name="end"><parm>tabela</parm> </cmd>
+</xsl:template>
+
+<xsl:template match="r" mode="tabela">
+<!-- R<xsl:value-of select="count(preceding-sibling::*)" />-->
+ <xsl:choose>
+ <xsl:when test="count(preceding-sibling::*) = 0">
+ <cmd name="tabelanaglowek"><parm>
+ <xsl:apply-templates mode="tabelanaglowek"/>
+ </parm></cmd>
+ </xsl:when>
+ <xsl:otherwise>
+ <cmd name="tabelawiersz"><parm>
+ <xsl:apply-templates mode="tabelawiersz"/>
+ </parm></cmd>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="c" mode="tabelanaglowek">
+ <xsl:if test="count(preceding-sibling::*) > 0"><spec cat="align"/></xsl:if>
+ <cmd name="tabelakomnaglowek"><parm>
+ <xsl:apply-templates mode="inline"/>
+ </parm></cmd>
+</xsl:template>
+
+<xsl:template match="c" mode="tabelawiersz">
+
+ <xsl:choose>
+ <xsl:when test="count(preceding-sibling::*) = 0">
+ <cmd name="tabelakompierwsza"><parm>
+ <xsl:apply-templates mode="inline"/>
+ </parm></cmd>
+ </xsl:when>
+ <xsl:otherwise>
+ <spec cat="align"/><cmd name="tabelakom"><parm>
+ <xsl:apply-templates mode="inline"/>
+ </parm></cmd>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+