我正在使用以下转换从 XML 创建表
<fo:table table-layout="fixed" width="100%">
<fo:table-header>
<fo:table-row text-align="right" font-weight="bold">
<fo:table-cell column-number="2" text-align="center">
<fo:block>ColA</fo:block>
</fo:table-cell>
<fo:table-cell column-number="3" text-align="center">
<fo:block>Name</fo:block>
</fo:table-cell>
<fo:table-cell column-number="4">
<fo:block color="red">ColB</fo:block>
</fo:table-cell>
<fo:table-cell column-number="5" text-align="center"
color="red">
<fo:block width="1cm">%</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:apply-templates select="list/v" />
</fo:table-body>
</fo:table>
简而言之,我为每个“list/v”创建一行
我的问题是,是否没有相应的数据,我得到以下异常
org.apache.fop.fo.ValidationException: "fo:table-body" is missing child elements. Required content model: marker* (table-row+|table-cell+) (No context info available)
因此我的问题是:当没有数据可用时,如何创建没有正文的有效表?