I have a situation where I need to convert a nested HTML list like this:
<ol>
<li>Item 1
<ol>
<li> Item 1.1
<ol>
<li>Item 1.1.1</li>
<li>Item 1.1.2</li>
</ol>
</li>
</ol>
</li>
<li>Item 2
<ol>
<li> Item 2.1
<ol>
<li>Item 2.1.1</li>
<li>Item 2.1.2</li>
</ol>
</li>
</ol>
</li>
Into separate indented tables (where each ol is a table, indented properly to look like the nested table). What would be the best way to do this? I've looked that the HtmlAgility pack, but I couldn't figure out how to replace tags once I found them (I was able to find all the appropriate tags, but couldn't do anything with them)...
Basically, I need the output table(s) to look something like this:
<table>
<tr>
<td>
•
</td>
<td>
Item 1
</td>
</tr>
</table>
<table style="margin-left: 5px;">
<tr>
<td>
•
</td>
<td>
Item 1.1
</td>
</tr>
</table>
<table style="margin-left: 10px;">
<tr>
<td>
•
</td>
<td>
Item 1.1.1
</td>
</tr>
<tr>
<td>
•
</td>
<td>
Item 1.1.2
</td>
</tr>
</table>
<table>
<tr>
<td>
•
</td>
<td>
Item 2
</td>
</tr>
</table>
<table style="margin-left: 5px;">
<tr>
<td>
•
</td>
<td>
Item 2.1
</td>
</tr>
</table>
<table style="margin-left: 10px;">
<tr>
<td>
•
</td>
<td>
Item 2.1.1
</td>
</tr>
<tr>
<td>
•
</td>
<td>
Item 2.1.2
</td>
</tr>
</table>