I'm using FOP to transform HTML(embedded in XML) to PDF. The HTML snippet is like below:-
<table border="1" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody/>
</table>
When I transform, I get this error:-
Caused by: org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-body i
s missing child elements.
Required Content Model: marker* (table-row+|table-cell+)
I got the similar error when removing the <tbody/>
element:-
org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table is missing child
elements.
Required Content Model: (marker*,table-column*,table-header?,table-footer?,table-body+)
Looks like table-body is required to fo:table and table-row is required to table-body. My question is:-
Is it possible to create a table with only table-header and without table-body or with an empty table-body?
You can ofcourse, the the following way:
<fo:table-body>
<fo:table-cell
s even if it requires