Python 如何从xsl文件中删除头文件而不在pdf下载时爆炸
我想删除这个估计标题和下面的黑线。我试着把它去掉Python 如何从xsl文件中删除头文件而不在pdf下载时爆炸,python,xml,pdf,xslt,xsl-fo,Python,Xml,Pdf,Xslt,Xsl Fo,我想删除这个估计标题和下面的黑线。我试着把它去掉 <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>
<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)')
黑色
0.7磅
固体
估计的
(“无法生成PDF”,
b'Exception\norg.apache.fop.apps.fopeexception:org.apache.fop.fo.ValidationException:
“fo:表格单元格”缺少子元素。所需的内容模型:标记*(%block;)+(请参见位置8:104)
javax.xml.transform.TransformerException:org.apache.fop.fo.ValidationException:
“fo:表格单元格”缺少子元素。所需的内容模型:标记*(%block;)+(请参见位置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')
黑色
0.7磅
固体
(“无法生成PDF.”,b“异常\norg.apache.fop.apps.FOPException:org.apache.fop.fo.ValidationException:
行中的列数或单元格数溢出了为表指定的fo:table列数。(请参阅位置25:15)
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException:行中的列数或单元格数溢出了为表指定的fo:table列数。(请参见位置25:15)\n\n')
无法生成PDF的部分是自定义的
这个xsl-fo的东西真的很挑剔,有人知道为什么我不能在不炸掉它的情况下删除其中一个吗?多谢各位
如果要显示每次删除的内容,则删除整个fo:block
会留下一个没有内容的fo:table单元格。“marker*(%block;)+”告诉您,fo:table cell
预期有一个或多个块级FOs(在零个或多个fo:marker
之后)
第二个问题可能与删除属性无关。FOP可能在检查FOs的内容后检查表布局。第一个示例中错误的位置与第二个示例中错误消息的位置非常不同。检查它告诉你的线路
如果你想在让FOP抱怨之前检查你的FO,你会发现你的表单元格是空的,但它并没有检查表布局
顺便说一句,您的三个xsl:attribute
只需一个边框即可完成