Reputation: 11773
We use the DocBook XSLTs to convert CALS tables to HTML for Web output. Some of our CALS tables contain HTML markup, specifically lists. I'm not sure if this is normal, but our print (PDF) formatting engine - which gets the CALS tables as input - handles it.
However, when the CALS tables are transformed HTML, the list markup with tags are rendered to strings, and the list nesting is preserved in spans (weird!).
Update: I suspect I must be doing something wrong in my application of the DocBook XSLTs, which is intended to convert tables while simply copying all other content from a mixed content-type document. Here is a reproducible example:
CALS input:
<section>
<table>
<tgroup cols="1">
<colspec colname="col1"/>
<tbody>
<row>
<entry>
<ol list-style-type="lower-alpha" period-paren="paren">
<li>This is a nested list:<ol list-style-type="number" period-paren="paren">
<li>I'm a list item.</li>
<li>I'm another list item!</li>
</ol></li>
<li>Yet another nested list:<ol list-style-type="number" period-paren="paren">
<li>YALI</li>
<li>YAYALI</li>
</ol></li>
</ol>
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
XSLT:
<xsl:stylesheet version="2.0"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="docbook-xsl-1.75.2/xhtml/docbook.xsl"/>
<xsl:template match="/ | /*">
<xsl:apply-templates mode="initial"/>
</xsl:template>
<xsl:template match="table" mode="initial">
<xsl:apply-templates select="." mode="#default"/>
</xsl:template>
<xsl:template match="@*|node()" mode="initial">
<xsl:copy>
<xsl:apply-templates select="@*|node()" mode="#current"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Output:
<section><div class="table" xmlns="http://www.w3.org/1999/xhtml">
<a id="n5dd3b973684deaa" xmlns:saxon="http://icl.com/saxon"></a><p class="title"><b></b></p>
<div class="table-contents">
<table border="1"><tbody><tr><td>
<span style="color: red"><ol>
<span style="color: red"><li>This is a nested list:<span style="color: red"><ol>
<span style="color: red"><li>I'm a list item.</li></span>
<span style="color: red"><li>I'm another list item!</li></span>
</ol></span></li></span>
<span style="color: red"><li>Yet another nested list:<span style="color: red"><ol>
<span style="color: red"><li>YALI</li></span>
<span style="color: red"><li>YAYALI</li></span>
</ol></span></li></span>
</ol></span>
</td></tr></tbody></table>
</div></div>
<br class="table-break" xmlns="http://www.w3.org/1999/xhtml"/>
</section>
Upvotes: 1
Views: 178
Reputation: 11773
Although I was not able to determine the reason for the escaped markup, the HTML markup can be overridden simply, with a higher priority template in the main XSLT:
<xsl:template match="ol" mode="#all">
<xsl:copy-of select="."/>
</xsl:template>
Upvotes: 0