Hi,

  i have problem with table conversion from xml to html using xslt. i converted rowspan and colspan in separate row(entry), but if both rowspan and colspan come in single row(entry, colspan and rowspan) is not converting. i have tried so many ways but i didn't get the exact output. kindly suggest to me. 
  I have attached input file as xml and png file for your references.

Reference Table
5b42c8ea0cecd6373b6acd405b28322d
Input xml file

     <?xml version="1.0" encoding="UTF-8"?>
     <table>
<name>Table A(2b)<line.break/>Attributable Ownership Interest by Ethnicity<line.break/>Stations with One or More Attributable Persons<line.break/>Full Power Commercial Television Stations - 2013</name>
<tgroup frame="all" cols="10" rowsep="1" colsep="1">
<colspec colnum="1" colname="col1" colwidth="20*" align="left"/>
<colspec colnum="2" colname="col2" colwidth="16*" align="left"/>
<colspec colnum="3" colname="col3" colwidth="8*" align="right"/>
<colspec colnum="4" colname="col4" colwidth="8*" align="right"/>
<colspec colnum="5" colname="col5" colwidth="8*" align="right"/>
<colspec colnum="6" colname="col6" colwidth="8*" align="right"/>
<colspec colnum="7" colname="col7" colwidth="8*" align="right"/>
<colspec colnum="8" colname="col8" colwidth="8*" align="right"/>
<colspec colnum="9" colname="col9" colwidth="8*" align="right"/>
<colspec colnum="10" colname="col10" colwidth="8*" align="right"/>
<spanspec namest="col3" nameend="col10" spanname="sp1" align="center"/>
<spanspec namest="col3" nameend="col4" spanname="sp2" align="center"/>
<spanspec namest="col5" nameend="col6" spanname="sp3" align="center"/>
<spanspec namest="col7" nameend="col8" spanname="sp4" align="center"/>
<spanspec namest="col9" nameend="col10" spanname="sp5" align="center"/>
<spanspec namest="col1" nameend="col2" spanname="sp6" align="left"/>
<thead>
<row>
<entry spanname="sp6" morerows="2" align="center"><text>Ethnicity</text></entry>
<entry spanname="sp1"><text>No. of Stations and Percent of Total</text></entry>
</row>
<row>
<entry spanname="sp2"><text>Nationally</text></entry>
<entry spanname="sp3"><text>Nielsen<line.break/>DMA 1-50</text></entry>
<entry spanname="sp4"><text>DMA<line.break/>51-100</text></entry>
<entry spanname="sp5"><text>DMA<line.break/>101+</text></entry>
</row>
<row>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
</row>
</thead>
<tbody>
<row>
<entry morerows="2"><text><emph face="B">Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>96</text></entry>
<entry><text>7.7</text></entry>
<entry><text>69</text></entry>
<entry><text>14.8</text></entry>
<entry><text>9</text></entry>
<entry><text>2.7</text></entry>
<entry><text>18</text></entry>
<entry><text>4.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>274</text></entry>
<entry><text>22.1</text></entry>
<entry><text>153</text></entry>
<entry><text>32.9</text></entry>
<entry><text>56</text></entry>
<entry><text>17.0</text></entry>
<entry><text>65</text></entry>
<entry><text>14.6</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">322</emph></text></entry>
<entry><text><emph face="B">26.0</emph></text></entry>
<entry><text>189</text></entry>
<entry><text>40.6</text></entry>
<entry><text>64</text></entry>
<entry><text>19.4</text></entry>
<entry><text>69</text></entry>
<entry><text>15.5</text></entry>
</row>
<row>
<entry morerows="2"><text><emph face="B">Non-Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>984</text></entry>
<entry><text>79.4</text></entry>
<entry><text>404</text></entry>
<entry><text>86.9</text></entry>
<entry><text>273</text></entry>
<entry><text>82.7</text></entry>
<entry><text>307</text></entry>
<entry><text>69.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>1,201</text></entry>
<entry><text>96.9</text></entry>
<entry><text>458</text></entry>
<entry><text>98.5</text></entry>
<entry><text>327</text></entry>
<entry><text>99.1</text></entry>
<entry><text>416</text></entry>
<entry><text>93.7</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">1,210</emph></text></entry>
<entry><text><emph face="B">97.7</emph></text></entry>
<entry><text>460</text></entry>
<entry><text>98.9</text></entry>
<entry><text>329</text></entry>
<entry><text>99.7</text></entry>
<entry><text>421</text></entry>
<entry><text>94.8</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Total stations</emph></text></entry>
<entry><text><emph face="B">1,239</emph></text></entry>
<entry><text><emph face="B">100%</emph></text></entry>
<entry><text>465</text></entry>
<entry><text>100%</text></entry>
<entry><text>330</text></entry>
<entry><text>100%</text></entry>
<entry><text>444</text></entry>
<entry><text>100%</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Insufficient data</emph></text></entry>
<entry><text>147</text></entry>
<entry><text>---</text></entry>
<entry><text>75</text></entry>
<entry><text>---</text></entry>
<entry><text>30</text></entry>
<entry><text>---</text></entry>
<entry><text>42</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Stations not filed</emph></text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">All licensed stations</emph></text></entry>
<entry><text><emph face="B">1,387</emph></text></entry>
<entry><text>---</text></entry>
<entry><text>540</text></entry>
<entry><text>---</text></entry>
<entry><text>360</text></entry>
<entry><text>---</text></entry>
<entry><text>487</text></entry>
<entry><text>---</text></entry>
</row>
</tbody>
</tgroup>
</table>



<?xml-stylesheet type="text/xsl" href="FCC_Template.xsl"?><table>
<name>Table A(2b)<line.break/>Attributable Ownership Interest by Ethnicity<line.break/>Stations with One or More Attributable Persons<line.break/>Full Power Commercial Television Stations - 2013</name>
<tgroup frame="all" cols="10" rowsep="1" colsep="1">
<colspec colnum="1" colname="col1" colwidth="20*" align="left"/>
<colspec colnum="2" colname="col2" colwidth="16*" align="left"/>
<colspec colnum="3" colname="col3" colwidth="8*" align="right"/>
<colspec colnum="4" colname="col4" colwidth="8*" align="right"/>
<colspec colnum="5" colname="col5" colwidth="8*" align="right"/>
<colspec colnum="6" colname="col6" colwidth="8*" align="right"/>
<colspec colnum="7" colname="col7" colwidth="8*" align="right"/>
<colspec colnum="8" colname="col8" colwidth="8*" align="right"/>
<colspec colnum="9" colname="col9" colwidth="8*" align="right"/>
<colspec colnum="10" colname="col10" colwidth="8*" align="right"/>
<spanspec namest="col3" nameend="col10" spanname="sp1" align="center"/>
<spanspec namest="col3" nameend="col4" spanname="sp2" align="center"/>
<spanspec namest="col5" nameend="col6" spanname="sp3" align="center"/>
<spanspec namest="col7" nameend="col8" spanname="sp4" align="center"/>
<spanspec namest="col9" nameend="col10" spanname="sp5" align="center"/>
<spanspec namest="col1" nameend="col2" spanname="sp6" align="left"/>
<thead>
<row>
<entry spanname="sp6" morerows="2" align="center"><text>Ethnicity</text></entry>
<entry spanname="sp1"><text>No. of Stations and Percent of Total</text></entry>
</row>
<row>
<entry spanname="sp2"><text>Nationally</text></entry>
<entry spanname="sp3"><text>Nielsen<line.break/>DMA 1-50</text></entry>
<entry spanname="sp4"><text>DMA<line.break/>51-100</text></entry>
<entry spanname="sp5"><text>DMA<line.break/>101+</text></entry>
</row>
<row>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
</row>
</thead>
<tbody>
<row>
<entry morerows="2"><text><emph face="B">Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>96</text></entry>
<entry><text>7.7</text></entry>
<entry><text>69</text></entry>
<entry><text>14.8</text></entry>
<entry><text>9</text></entry>
<entry><text>2.7</text></entry>
<entry><text>18</text></entry>
<entry><text>4.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>274</text></entry>
<entry><text>22.1</text></entry>
<entry><text>153</text></entry>
<entry><text>32.9</text></entry>
<entry><text>56</text></entry>
<entry><text>17.0</text></entry>
<entry><text>65</text></entry>
<entry><text>14.6</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">322</emph></text></entry>
<entry><text><emph face="B">26.0</emph></text></entry>
<entry><text>189</text></entry>
<entry><text>40.6</text></entry>
<entry><text>64</text></entry>
<entry><text>19.4</text></entry>
<entry><text>69</text></entry>
<entry><text>15.5</text></entry>
</row>
<row>
<entry morerows="2"><text><emph face="B">Non-Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>984</text></entry>
<entry><text>79.4</text></entry>
<entry><text>404</text></entry>
<entry><text>86.9</text></entry>
<entry><text>273</text></entry>
<entry><text>82.7</text></entry>
<entry><text>307</text></entry>
<entry><text>69.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>1,201</text></entry>
<entry><text>96.9</text></entry>
<entry><text>458</text></entry>
<entry><text>98.5</text></entry>
<entry><text>327</text></entry>
<entry><text>99.1</text></entry>
<entry><text>416</text></entry>
<entry><text>93.7</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">1,210</emph></text></entry>
<entry><text><emph face="B">97.7</emph></text></entry>
<entry><text>460</text></entry>
<entry><text>98.9</text></entry>
<entry><text>329</text></entry>
<entry><text>99.7</text></entry>
<entry><text>421</text></entry>
<entry><text>94.8</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Total stations</emph></text></entry>
<entry><text><emph face="B">1,239</emph></text></entry>
<entry><text><emph face="B">100%</emph></text></entry>
<entry><text>465</text></entry>
<entry><text>100%</text></entry>
<entry><text>330</text></entry>
<entry><text>100%</text></entry>
<entry><text>444</text></entry>
<entry><text>100%</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Insufficient data</emph></text></entry>
<entry><text>147</text></entry>
<entry><text>---</text></entry>
<entry><text>75</text></entry>
<entry><text>---</text></entry>
<entry><text>30</text></entry>
<entry><text>---</text></entry>
<entry><text>42</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Stations not filed</emph></text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">All licensed stations</emph></text></entry>
<entry><text><emph face="B">1,387</emph></text></entry>
<entry><text>---</text></entry>
<entry><text>540</text></entry>
<entry><text>---</text></entry>
<entry><text>360</text></entry>
<entry><text>---</text></entry>
<entry><text>487</text></entry>
<entry><text>---</text></entry>
</row>
</tbody>
</tgroup>
</table>

Regards,
Balaji V

show the original XML file

Sorry for the delay....

I pasted xml file below.

<?xml-stylesheet type="text/xsl" href="FCC_Template.xsl"?><table>
<name>Table A(2b)<line.break></line>Attributable Ownership Interest by Ethnicity<line.break></line>Stations with One or More Attributable Persons<line.break></line>Full Power Commercial Television Stations - 2013</name>
<tgroup frame="all" cols="10" rowsep="1" colsep="1">
<colspec colnum="1" colname="col1" colwidth="20" align="left"/>
<colspec colnum="2" colname="col2" colwidth="16
" align="left"/>
<colspec colnum="3" colname="col3" colwidth="8" align="right"/>
<colspec colnum="4" colname="col4" colwidth="8
" align="right"/>
<colspec colnum="5" colname="col5" colwidth="8" align="right"/>
<colspec colnum="6" colname="col6" colwidth="8
" align="right"/>
<colspec colnum="7" colname="col7" colwidth="8" align="right"/>
<colspec colnum="8" colname="col8" colwidth="8
" align="right"/>
<colspec colnum="9" colname="col9" colwidth="8" align="right"/>
<colspec colnum="10" colname="col10" colwidth="8
" align="right"/>
<spanspec namest="col3" nameend="col10" spanname="sp1" align="center"></spanspec>
<spanspec namest="col3" nameend="col4" spanname="sp2" align="center"></spanspec>
<spanspec namest="col5" nameend="col6" spanname="sp3" align="center"></spanspec>
<spanspec namest="col7" nameend="col8" spanname="sp4" align="center"></spanspec>
<spanspec namest="col9" nameend="col10" spanname="sp5" align="center"></spanspec>
<spanspec namest="col1" nameend="col2" spanname="sp6" align="left"></spanspec>
<thead>
<row>
<entry spanname="sp6" morerows="2" align="center"><text>Ethnicity</text></entry>
<entry spanname="sp1"><text>No. of Stations and Percent of Total</text></entry>
</row>
<row>
<entry spanname="sp2"><text>Nationally</text></entry>
<entry spanname="sp3"><text>Nielsen<line.break></line>DMA 1-50</text></entry>
<entry spanname="sp4"><text>DMA<line.break></line>51-100</text></entry>
<entry spanname="sp5"><text>DMA<line.break></line>101+</text></entry>
</row>
<row>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
<entry align="center"><text>No.</text></entry>
<entry align="center"><text>%</text></entry>
</row>
</thead>
<tbody>
<row>
<entry morerows="2"><text><emph face="B">Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>96</text></entry>
<entry><text>7.7</text></entry>
<entry><text>69</text></entry>
<entry><text>14.8</text></entry>
<entry><text>9</text></entry>
<entry><text>2.7</text></entry>
<entry><text>18</text></entry>
<entry><text>4.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>274</text></entry>
<entry><text>22.1</text></entry>
<entry><text>153</text></entry>
<entry><text>32.9</text></entry>
<entry><text>56</text></entry>
<entry><text>17.0</text></entry>
<entry><text>65</text></entry>
<entry><text>14.6</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">322</emph></text></entry>
<entry><text><emph face="B">26.0</emph></text></entry>
<entry><text>189</text></entry>
<entry><text>40.6</text></entry>
<entry><text>64</text></entry>
<entry><text>19.4</text></entry>
<entry><text>69</text></entry>
<entry><text>15.5</text></entry>
</row>
<row>
<entry morerows="2"><text><emph face="B">Non-Hispanic or Latino</emph></text></entry>
<entry rowsep="0"><text>Female</text></entry>
<entry><text>984</text></entry>
<entry><text>79.4</text></entry>
<entry><text>404</text></entry>
<entry><text>86.9</text></entry>
<entry><text>273</text></entry>
<entry><text>82.7</text></entry>
<entry><text>307</text></entry>
<entry><text>69.1</text></entry>
</row>
<row>
<entry rowsep="0"><text>Male</text></entry>
<entry><text>1,201</text></entry>
<entry><text>96.9</text></entry>
<entry><text>458</text></entry>
<entry><text>98.5</text></entry>
<entry><text>327</text></entry>
<entry><text>99.1</text></entry>
<entry><text>416</text></entry>
<entry><text>93.7</text></entry>
</row>
<row>
<entry><text><emph face="B">Total</emph></text></entry>
<entry><text><emph face="B">1,210</emph></text></entry>
<entry><text><emph face="B">97.7</emph></text></entry>
<entry><text>460</text></entry>
<entry><text>98.9</text></entry>
<entry><text>329</text></entry>
<entry><text>99.7</text></entry>
<entry><text>421</text></entry>
<entry><text>94.8</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Total stations</emph></text></entry>
<entry><text><emph face="B">1,239</emph></text></entry>
<entry><text><emph face="B">100%</emph></text></entry>
<entry><text>465</text></entry>
<entry><text>100%</text></entry>
<entry><text>330</text></entry>
<entry><text>100%</text></entry>
<entry><text>444</text></entry>
<entry><text>100%</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Insufficient data</emph></text></entry>
<entry><text>147</text></entry>
<entry><text>---</text></entry>
<entry><text>75</text></entry>
<entry><text>---</text></entry>
<entry><text>30</text></entry>
<entry><text>---</text></entry>
<entry><text>42</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">Stations not filed</emph></text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>0</text></entry>
<entry><text>---</text></entry>
<entry><text>1</text></entry>
<entry><text>---</text></entry>
</row>
<row>
<entry spanname="sp6"><text><emph face="B">All licensed stations</emph></text></entry>
<entry><text><emph face="B">1,387</emph></text></entry>
<entry><text>---</text></entry>
<entry><text>540</text></entry>
<entry><text>---</text></entry>
<entry><text>360</text></entry>
<entry><text>---</text></entry>
<entry><text>487</text></entry>
<entry><text>---</text></entry>
</row>
</tbody>
</tgroup>
</table>

<html>
<head>
<title>Tables 2</title>
</head>

<body>
<br><br>
<table border="1" align="center" cellspacing="0" width="1000" height="500">

<tr>
<th colspan="10" bgcolor="LightCyan">Table A(2b)

<font size="4" color="darkred"><pre><strong>Attribute Ownership Interest by Ethnicity</strong>
Stations with One or One Attribute Persons
<strong>Full Power commercial television Stations - 2013</strong>
</pre></font>

<tr>
<th rowspan="3" colspan="2" bgcolor="LightBlue">Ethnicity</th>
<th colspan="9" bgcolor="lightsalmon">No: of Stations and Persons of Total</th>
</tr>

<tr>
<th colspan="2"bgcolor="lawngreen">Nationally</th>
<td colspan="2" bgcolor="greenyellow">Nielson DMA 1-50</td>
<td colspan="2" bgcolor="lawngreen">DMA 51-100</td>
<td colspan="2" bgcolor="greenyellow">DMA 101+</td>
</tr>

<tr>

<th>No</th>
<th>%</th>
<th>No</th>
<th>%</th>
<th>No</th>
<th>%</th>
<th>No</th>
<th>%</th>

</tr>

<tr>
<th rowspan="3" bgcolor="LightGreen">Hispanic and Latino</th>
<td>Female</td>
<td>96</td>
<td>7.7</td>
<td>69</td>
<td>14.3</td>
<td>9</td>
<td>2.7</td>
<td>18</td>
<td>4.3</td>
</tr>

<tr>
<td>Male</td>
<td>96</td>
<td>7.7</td>
<td>69</td>
<td>14.3</td>
<td>9</td>
<td>2.7</td>
<td>18</td>
<td>4.3</td>
</tr>

<tr>
<th bgcolor="Gold">Total</th>
<td>322</td>
<td>26.0</td>
<td>189</td>
<td>40.6</td>
<td>64</td>
<td>19.4</td>
<td>69</td>
<td>25.5</td>
</tr>

<tr>
<th rowspan="3" bgcolor="MistyRose">Non-Hispanic and Latino</th>
<td>Female</td>
<td>96</td>
<td>7.7</td>
<td>69</td>
<td>14.3</td>
<td>9</td>
<td>2.7</td>
<td>18</td>
<td>4.3</td>
</tr>

<tr>
<td>Male</td>
<td>96</td>
<td>7.7</td>
<td>69</td>
<td>14.3</td>
<td>9</td>
<td>2.7</td>
<td>18</td>
<td>4.3</td>
</tr>

<tr>
<th bgcolor="Gold">Total</th>
<td>322</td>
<td>26.0</td>
<td>189</td>
<td>40.6</td>
<td>64</td>
<td>19.4</td>
<td>69</td>
<td>25.5</td>
</tr>

<tr>
<th colspan="2" bgcolor="Mediumpurple" align="left">Total Stations</th>
<th>1,239</th>
<th>100%</th>
<td>465</td>
<td>100%</td>
<td>330</td>
<td>100%</td>
<td>444</td>
<td>100%</td>
</tr>

<tr>
<th colspan="2" align="left"bgcolor="MediumTurquoise">Insufficient Data</th>
<th>1,239</th>
<th>100%</th>
<td>465</td>
<td>100%</td>
<td>330</td>
<td>100%</td>
<td>444</td>
<td>100%</td>
</tr>

<tr>
<th colspan="2" align="left" bgcolor="powderblue">Stations not filed</th>
<th>1,239</th>
<th>100%</th>
<td>465</td>
<td>100%</td>
<td>330</td>
<td>100%</td>
<td>444</td>
<td>100%</td>
</tr>

<tr>
<th colspan="2" align="left" bgcolor="whitesmoke">All lisenced stations</th>
<th>1,239</th>
<th>100%</th>
<td>465</td>
<td>100%</td>
<td>330</td>
<td>100%</td>
<td>444</td>
<td>100%</td>
</tr>

</table>

</body>
</html>

Screenshot_2023-01-26-04-41-12-951-edit_cn.wps.moffice_eng.jpg

This post has no text-based content.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.