Import tables for Wax 2
Wax 2 supports tables. The differences between what the XSweet pipeline currently produces and the format Wax 2 uses is not big:
- XSweet's
<td>
s have astyle
attribute; Wax does not - XSweet's
<p>
s do not have aclass
but Wax's do - XSweet doesn't wrap the table in a
<tbody>
tag; Wax does
XSweet output:
<table>
<tr>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>One</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Two</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Three</p>
</td>
</tr>
<tr>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Four</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Five</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Six</p>
</td>
</tr>
<tr>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Seven</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Eight</p>
</td>
<td style="border-bottom-style: solid; border-bottom-width: 0.5pt; border-left-style: solid; border-left-width: 0.5pt; border-right-style: solid; border-right-width: 0.5pt; border-top-style: solid; border-top-width: 0.5pt; vertical-align: top">
<p>Nine</p>
</td>
</tr>
</table>
Wax 2 table:
<table>
<tbody>
<tr>
<td>
<p class="paragraph">one</p>
</td>
<td>
<p class="paragraph">two</p>
</td>
<td>
<p class="paragraph">three</p>
</td>
</tr>
<tr>
<td>
<p class="paragraph">four</p>
</td>
<td>
<p class="paragraph">five</p>
</td>
<td>
<p class="paragraph">six</p>
</td>
</tr>
<tr>
<td>
<p class="paragraph">seven</p>
</td>
<td>
<p class="paragraph">eight</p>
</td>
<td>
<p class="paragraph">ten</p>
</td>
</tr>
</tbody>
</table>
When an XSweet table like the first example is passed in, Wax appears to gloss over the differences seamlessly, adding class
attributes and a body
tag, and dropping the style
information entirely. That is great news.
To complete table import into Wax 2, the only change need (that I can identify) is to pass tables through the final editoria-reduce.xsl
step. Currently, that drops all table tags, leaving cell contents unchanged.