HI,
I've created a sample for, you can download here: Adobe Document Cloud
It has a table with 3 different header and row types, one per data type.
The table rows are bound to the corresponding data nodes by using predicates.
For example, the row that's intended to display the life insurances data is bound this way.
$.Table.[type=="life_insurance"]
This is the sample data:
<?xml version="1.0" encoding="UTF-8"?>
<Table_wrapper>
<header>Title1</header>
<Table type="life_insurance">
<Price>49.99</Price>
<Period>12 Months</Period>
<AssociatedRelatives>Paul, John</AssociatedRelatives>
</Table>
<Table type="fruits">
<Qty>100</Qty>
<Price>.99</Price>
<Color>Blue</Color>
<Descriprion>Berries</Descriprion>
</Table>
<Table type="person">
<Firstname>John</Firstname>
<Lastname>Doe</Lastname>
<Age>99</Age>
<Gender>M</Gender>
</Table>
<Table type="fruits">
<Qty>2</Qty>
<Price>3.55</Price>
<Color>red</Color>
<Descriprion>Apple</Descriprion>
</Table>
<Table type="person">
<Firstname>Paul</Firstname>
<Lastname>Doe</Lastname>
<Age>77</Age>
<Gender>M</Gender>
</Table>
</Table_wrapper>
The final table after the XML above has been loaded into the form.
The visibility of the header rows is controlled by a script in the form ready event of the table.
_HeaderType1.setInstances(_RowType1.count > 0 ? 1 : 0);
_HeaderType2.setInstances(_RowType2.count > 0 ? 1 : 0);
_HeaderType3.setInstances(_RowType3.count > 0 ? 1 : 0);