我正在使用 FOP 将 HTML(嵌入在 XML 中)转换为 PDF。HTML 片段如下所示:-
<table border="1" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody/>
</table>
当我转换时,我收到此错误:-
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+)
删除<tbody/>
元素时出现类似错误:-
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+)
看起来像 fo:table 需要 table-body,而 table-body 需要 table-row。我的问题是:-
是否可以创建一个只有表头而没有表体或空表体的表?