我正在尝试根据下面显示的 xml 文件输入生成 HTML 代码,预期如下所示,在某处我弄乱了逻辑,我得到了不同的输出..有人能指出问题所在吗?
Input :-cr_fixes.xml file
<Fixes>
CR FA CL Title
409452 WLAN 656885 Age out RSSI values from buffer
409452, 12345 To Record HAL and SLM FW Event Logging
</Fixes>
预期输出:-
<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
<td><a href="http://prism/CR/409452">409452</a></td>
<td>WLAN</td>
<td>656885</td>
<td>Age out RSSI values from buffer </td>
</tr>
<tr>
<td><a href=http://data/409452>409452</a>,<a href=http://data/12345>12345</a></td>
<td></td>
<td></td>
<td>To Record HAL and SLM FW Event Logging</td>
</tr>
</table>
实际输出:-
<table cellspacing="1" cellpadding="1" border="1">
<tr>
<th bgcolor="#67B0F9" scope="col">CR</th>
<th bgcolor="#67B0F9" scope="col">FA</th>
<th bgcolor="#67B0F9" scope="col">CL</th>
<th bgcolor="#67B0F9" scope="col">Title</th>
</tr>
<tr>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td><a href="http://prism/CR/409452">409452</a></td>
<td>WLAN</td>
<td>656885</td>
<td>Age out RSSI values from buffer </td>
</tr>
<tr>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td><a href="http://prism/CR/409452, 12345">409452, 12345</a></td>
<td></td>
<td></td>
<td>To Record HAL and SLM FW Event Logging</td>
</tr>
</table>
蟒蛇代码:-