</xsl:choose>
</xsl:template>
-<xsl:template match="table|example">
+<xsl:template match="table">
+ <xsl:choose>
+ <xsl:when test="tgroup|mediaobject|graphic">
+ <xsl:call-template name="calsTable"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:call-template name="htmlTable"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="calsTable">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
concat(local-name(.), ' '))"/>
</xsl:call-template>
</xsl:template>
+<xsl:template name="htmlTable">
+ <xsl:apply-templates mode="htmlTable"/>
+</xsl:template>
+
+<xsl:template match="example">
+ <xsl:variable name="param.placement"
+ select="substring-after(normalize-space($formal.title.placement),
+ concat(local-name(.), ' '))"/>
+
+ <xsl:variable name="placement">
+ <xsl:choose>
+ <xsl:when test="contains($param.placement, ' ')">
+ <xsl:value-of select="substring-before($param.placement, ' ')"/>
+ </xsl:when>
+ <xsl:when test="$param.placement = ''">before</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$param.placement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="formal.object">
+ <xsl:with-param name="placement" select="$placement"/>
+ <xsl:with-param name="class" select="local-name(.)"/>
+ </xsl:call-template>
+</xsl:template>
+
<xsl:template match="equation">
<xsl:variable name="param.placement"
select="substring-after(normalize-space($formal.title.placement),
</xsl:template>
<xsl:template match="informaltable">
- <xsl:call-template name="informal.object">
- <xsl:with-param name="class">
- <xsl:choose>
- <xsl:when test="@tabstyle">
- <xsl:value-of select="@tabstyle"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="local-name(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="tgroup|mediaobject|graphic">
+ <xsl:call-template name="informal.object">
+ <xsl:with-param name="class">
+ <xsl:choose>
+ <xsl:when test="@tabstyle">
+ <xsl:value-of select="@tabstyle"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="local-name(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <table>
+ <xsl:copy-of select="@*"/>
+ <xsl:call-template name="htmlTable"/>
+ </table>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="informaltable/textobject"></xsl:template>
-->
</xsl:template>
+<!-- ====================================================================== -->
+<!-- HTML Tables -->
+
+<xsl:template match="colgroup" mode="htmlTable">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates mode="htmlTable"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="col" mode="htmlTable">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="caption" mode="htmlTable">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+
+ <xsl:apply-templates select=".." mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="thead|tbody|tgroup|tr" mode="htmlTable">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates mode="htmlTable"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="th|td" mode="htmlTable">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/> <!-- *not* mode=htmlTable -->
+ </xsl:copy>
+</xsl:template>
+
</xsl:stylesheet>