Basic table parser

The result is a ParagraphStyle containing a Table element with all the appropriate properties. RowCount and ColCount are calculated and set. Rows are also included. All tr, th, and td elements are parsed inside the TableParser. Parsing of all other child elements is prevented.

RequestResponse

<table class="sample_table" cellspacing="0" cellpadding="0">

<tr>

<td>

<strong>Type</strong>

</td>

<td>

<strong>Name</strong>

</td>

<td>

<strong>Details</strong>

</td>

</tr>

<tr>

<td>

<strong>Layout</strong>

</td>

<td>

<p>Main.aspx</p>

</td>

<td>

<p>Main browser layout with header, footer and primary placeholder in between.</p>

</td>

</tr>

</table>

becomes

RequestResponse

<ParagraphStyle Style="NormalParagraphStyle">

<Table HeaderRows="0" FooterRows="0" ColCount="3" RowCount="2" TableStyle="sample_table" RepeatHeader="EveryTextColumn" RepeatFooter="EveryTextColumn">

<Row RowMin="1.0583333333333331" RowMax="211.66666666666666" RowHeight="AtLeast" StartRow="AnyWhere" KeepWithNext="False">

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle">

<Format Bold="True"><![CDATA[Type]]></Format>

</ParagraphStyle>

</Cell>

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle">

<Format Bold="True"><![CDATA[Name]]></Format>

</ParagraphStyle>

</Cell>

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle">

<Format Bold="True"><![CDATA[Details]]></Format>

</ParagraphStyle>

</Cell>

</Row>

<Row RowMin="1.0583333333333331" RowMax="211.66666666666666" RowHeight="AtLeast" StartRow="AnyWhere" KeepWithNext="False">

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle">

<Format Bold="True"><![CDATA[Layout]]></Format>

</ParagraphStyle>

</Cell>

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle"><![CDATA[Main.aspx]]></ParagraphStyle>

</Cell>

<Cell CellStyle="" HorStradle="0" VerStradle="0" ColWidth="5">

<ParagraphStyle Style="NormalParagraphStyle"><![CDATA[Main browser layout with header, footer and primary placeholder in between.]]></ParagraphStyle>

</Cell>

</Row>

</Table>

</ParagraphStyle>

Do you have some feedback for us?

If you have suggestions for improving this article,