DocBook 5到PDF转换失败并出现错误:“fo:flow”缺少子元素。必填内容模型:标记*

时间:2014-10-24 18:47:07

标签: xslt apache-fop docbook

我继承了一个doc发布流程,该流程使用Apache FOP同时使用DocBook并构建html和PDF输出。该项目已经启动,但从未完成。通过大量的调整,我能够获得大部分构建的文档集(20+),除了少数几个,并且它们都因为SEVERE代码而失败,并且具有以下两个条件之一:

"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错误,例如,#34; 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>

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

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:1)

嗯,你说错误是这样的:

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

肯定会是。这是空元素,里面没有任何内容。流的内容模型需要内部的东西,这是一个错误。所以你基本上有一个没有内容的页面。