gpt4 book ai didi

xslt - DocBook 5 到 PDF 的转换失败,出现错误 : "fo:flow" is missing child elements. 所需的内容模型:标记*

转载 作者:行者123 更新时间:2023-12-04 12:52:19 28 4
gpt4 key购买 nike

我继承了一个文档发布过程,该过程采用 DocBook 并构建 html 和 PDF 输出,同时使用 Apache FOP。这个项目已经开始,但从未完成。通过大量调整,我已经能够构建大部分文档集(20 多个),除了少数几个,并且它们都因以下两种情况之一的严重代码而失败:

"fo:flow" is missing child elements. Required content model: marker*
"fo:block" is not a valid child of "fo:root"

来自 docbook 和 docbook-fop 的 xml 输出检查为格式正确。

一本书中的 fop 错误,例如“EndecaGloss”,指向这个字符串的结尾:

<fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt"/>

这是这种情况下的日志输出:

[java] SEVERE: javax.xml.transform.TransformerException: file:/scratch/publishing/hudson/jobs/build-main-endeca-documentation/workspace/serverdoc/WorkingDoc/main/publishing/build-files/../output/fo/Gloss/EndecaGloss/EndecaGloss-fo.xml:11:10410: "fo:flow" is missing child elements. Required content model: marker* (%block;)+ (See position 11:10410)
[java] Oct 16, 2014 1:30:10 PM org.apache.fop.cli.Main startFOP

对于上下文,在 -fo.xml 文件中,它位于天线房的末尾,我认为它正在尝试为 PDF 设置页眉/页脚:

<fo:page-sequence xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" 
xmlns:fo="somenamespace"
hyphenate="false" master-reference="lot" language="en" format="i"
initial-page-number="auto-odd"
force-page-count="end-on-even" hyphenation-character="-"
hyphenation-push-character-count="2" hyphenation-remain-character-count="2">
<fo:static-content flow-name="xsl-region-before-first">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">

<fo:table table-layout="fixed" width="100%" border-bottom-width="1pt" border-bottom-style="solid" border-bottom-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(0)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/></fo:block></fo:table-cell>
<fo:table-cell text-align="center" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/></fo:block></fo:table-cell>
<fo:table-cell text-align="right" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>

</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-odd">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-bottom-width="1pt" border-bottom-style="solid" border-bottom-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(0)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-even">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-bottom-width="1pt" border-bottom-style="solid" border-bottom-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-before-blank">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-bottom-width="1pt" border-bottom-style="solid" border-bottom-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="before" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-footnote-separator">
<fo:block>
<fo:leader color="black" leader-pattern="rule" leader-length="1in"/>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after-first">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-top-width="1pt" border-top-style="solid" border-top-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(3)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"> Oracle Commerce Guided Search Glossary Version 11.1 • July 2014
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="end" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook">
<fo:page-number/>
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after-odd">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-top-width="1pt" border-top-style="solid" border-top-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(3)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"> Oracle Commerce Guided Search Glossary Version 11.1 • July 2014
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="end" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook">
<fo:page-number/>
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after-even">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-top-width="1pt" border-top-style="solid" border-top-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(3)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook">
<fo:page-number/>
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="end" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"> Oracle Commerce Guided Search Glossary Version 11.1 • July 2014
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after-blank">
<fo:block font-family="Myriad-Roman,Symbol,ZapfDingbats" margin-left="0pt" font-weight="bold">
<fo:table table-layout="fixed" width="100%" border-top-width="1pt" border-top-style="solid" border-top-color="black">
<fo:table-column column-number="1" column-width="proportional-column-width(1)"/>
<fo:table-column column-number="2" column-width="proportional-column-width(0)"/>
<fo:table-column column-number="3" column-width="proportional-column-width(3)"/>
<fo:table-body>
<fo:table-row block-progression-dimension.minimum="14pt">
<fo:table-cell text-align="start" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook">
<fo:page-number/>
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="end" display-align="after" relative-align="baseline">
<fo:block>
<fo:block xmlns:d="http://docbook.org/ns/docbook"> Oracle Commerce Guided Search Glossary Version 11.1 • July 2014
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt"/>
</fo:page-sequence>

有人知道这里发生了什么吗?

最佳答案

错误消息 marker* (%block;)+ 表明 flow 元素需要一些 block 内容,而在您的示例中该元素为空。

关于xslt - DocBook 5 到 PDF 的转换失败,出现错误 : "fo:flow" is missing child elements. 所需的内容模型:标记*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26554337/

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