I have a bunch of XML tables marked up using the CALS model and some of them have empty columns that I'd like to strip out. So here would be some example markup
<table frame="none">
<tgroup cols="4" colsep="0" rowsep="0">
<colspec colname="1" colnum="1" colwidth="75pt"/>
<colspec colname="2" colnum="2" colwidth="63pt" align="center"/>
<colspec colname="3" colnum="3" colwidth="63pt" align="center"/>
<colspec colname="4" colnum="4" colwidth="63pt"/>
<thead>
<row valign="bottom">
<entry> </entry>
<entry>No. 9</entry>
<entry>No. 10</entry>
<entry> </entry>
</row>
</thead>
<tbody>
<row>
<entry>Max. size:</entry>
<entry>10.5 m.</entry>
<entry>6.7 m.</entry>
<entry> </entry>
</row>
<row>
<entry>Length:</entry>
<entry>210 m.</entry>
<entry>100 m.</entry>
<entry> </entry>
</row>
<row>
<entry>Depth:</entry>
<entry>11.0</entry>
<entry>7.0</entry>
<entry> </entry>
</row>
</tbody>
</tgroup>
</table>
So it's column 4 in the above example that I would like to delete completely. In many (most?) cases it will be the last column, but it wont always be.
And you will note that column 4 does contain spaces, or possibly &# 160; characters.
So how would I go about removing such entire columns using xslt ?
TIA
Feargal
Please give this a try:
In addition to removing blank columns, it also takes care of renumbering the columns that are kept (I assumed you would want this), so with this input, where the second column is blank:
The result is: