如何在不破坏 pdf 下载的情况下从 xsl 文件中删除 header

how to remove header from xsl file without blowing up on pdf download

我想删除这条估计 header 和下面的黑线。我试过删除

                <fo:block text-align="center" padding-left="4pt" margin-left="4pt" margin-bottom="4pt" padding-bottom="4pt">
                <xsl:attribute name="border-bottom-color">black</xsl:attribute>
                <xsl:attribute name="border-bottom-width">0.7pt</xsl:attribute>
                <xsl:attribute name="border-bottom-style">solid</xsl:attribute>

                    Estimated
                </fo:block>

('Unable to generate PDF.', 
b'Exception\norg.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: 
"fo:table-cell" is missing child elements. Required content model: marker* (%block;)+ (See position 8:104)
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException:
 "fo:table-cell" is missing child elements. Required content model: marker* (%block;)+ (See position 48:104)')

尝试只删除 "Estimated"、

这个词

甚至尝试删除黑条:

                <xsl:attribute name="border-bottom-color">black</xsl:attribute>
                <xsl:attribute name="border-bottom-width">0.7pt</xsl:attribute>
                <xsl:attribute name="border-bottom-style">solid</xsl:attribute>

('Unable to generate PDF.', b'Exception\norg.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: 
The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table. (See position 25:15)
javax.xml.transform.TransformerException: 
org.apache.fop.fo.ValidationException: The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table. (See position 25:15)\n\n')

Unable to generate PDF 部分是自定义的

这个 xsl-fo 东西真的很挑剔,有谁知道为什么我不能在不爆炸的情况下移除其中一个?谢谢

https://gist.github.com/codyc4321/d8b50adfb9fd1686355e

如果您每次都显示删除的内容,则删除整个 fo:block 会留下一个没有内容的 fo:table-cell。 "marker* (%block;)+" 告诉你 fo:table-cell 预计会有一个或多个块级 FO(在零个或多个 fo:marker 之后)。

您的第二个问题可能与删除属性无关。 FOP 可能在检查 FO 的内容后检查 table 布局。第一个示例中错误的位置与第二个示例中错误消息的位置非常不同。检查它告诉您的行。

如果你想在让 FOP 抱怨它之前检查你的 FO,https://github.com/AntennaHouse/focheck 会找到你的空 table 单元格,但它不会检查 table布局。

顺便说一句,你的三个 xsl:attribute 可以只用一个 border