gpt4 book ai didi

python - 如何从 xsl 文件中删除 header 而不导致 pdf 下载崩溃

转载 作者:行者123 更新时间:2023-12-01 04:10:04 24 4
gpt4 key购买 nike

我想删除这个估计标题和下面的黑线。我尝试过删除

                <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)')

尝试仅删除“估计”一词,

甚至尝试删除黑条:

                <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')

无法生成 PDF 部分是自定义的

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

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

enter image description here

最佳答案

如果您每次都显示删除的内容,则删除整个 fo:block 后会留下一个没有内容的 fo:table-cell。 “marker* (%block;)+”告诉您 fo:table-cell 预计会有一个或多个 block 级 FO(后面跟着零个或多个 fo:标记)。

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

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

顺便说一句,您的三个 xsl:attribute 只需一个 border 即可完成。

关于python - 如何从 xsl 文件中删除 header 而不导致 pdf 下载崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35067829/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com