最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【已解决】Docbook编译pdf出错:org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+

Docbook crifan 949浏览 0评论

【问题】

用docbook去编译pdf,结果出错:

SEVERE: Exception
org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:302)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
        at org.apache.fop.cli.Main.startFOP(Main.java:174)
        at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
        ... 3 more
Caused by: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
        at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:54)
        at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
        at $Proxy3.missingChildElement(Unknown Source)
        at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:549)
        at org.apache.fop.fo.flow.ListBlock.endOfNode(ListBlock.java:102)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
        ... 4 more

---------

javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:501)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
        at org.apache.fop.cli.Main.startFOP(Main.java:174)
        at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
        at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:54)
        at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
        at $Proxy3.missingChildElement(Unknown Source)
        at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:549)
        at org.apache.fop.fo.flow.ListBlock.endOfNode(ListBlock.java:102)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
        ... 4 more
---------
org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)
        at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
        at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:54)
        at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
        at $Proxy3.missingChildElement(Unknown Source)
        at org.apache.fop.fo.FONode.missingChildElementError(FONode.java:549)
        at org.apache.fop.fo.flow.ListBlock.endOfNode(ListBlock.java:102)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
        at org.apache.fop.cli.Main.startFOP(Main.java:174)
        at org.apache.fop.cli.Main.main(Main.java:205)

../../../config/docbook.mk:383: recipe for target `../output/pdf/csharp_summary.pdf' failed
make: *** [../output/pdf/csharp_summary.pdf] Error 1

CLi@PC-CLI-1 ~/develop/docbook/books/csharp_summary/src
$

如图:

org.apache.fop.fo.ValidationException

org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 3570:289)

【解决过程】

1.去对应fo文件中看看对应的内容是啥:

3570 line fo list block is empty

很明显,对应的fo:list-block的内容是空的,所以是不正常的。

2.所以,再去找到xml的源码中,看看对应的内容是啥:

    <para>给TreeNode添加右键的总体的思路是:</para>
    <orderedlist>
        <itemizedlist>添加ContextMenuStrip
        </itemizedlist>
        <itemizedlist>在其下添加子菜单
        </itemizedlist>
        <itemizedlist>实现ItemClicked事件,在其中判断点击了哪个子菜单,然后添加代码做你要做的事情即可。
            <para></para>
        </itemizedlist>
    </orderedlist>

对此,参考之前自己的例子:

例 6.16. 带指定编号类型的orderedlist

其写法是:

<orderedlist numeration="arabic">
    <listitem>总的帧数:<para>VBR中的总的帧的数目。</para></listitem>
    <listitem>帧的采样个数:<para>对于MP3(MPEG1,Layer III)来说,是固定的1152个采样。</para></listitem>
    <listitem>帧的采样率:<para>通过解析第一帧,即可得知帧采样率索引,查表,即可得此采样率。</para></listitem>
</orderedlist>

(以及:例 6.14. itemizedlist

很明显可以看出问题是:

orderedlist其下,应该是listitem,而不是itemizedlist

itemizedlist是和orderedlist并列级别的,表示无序列表

3.所以,去改为:

    <orderedlist numeration="arabic">
        <listitem>添加ContextMenuStrip
        </listitem>
        <listitem>在其下添加子菜单
        </listitem>
        <listitem>实现ItemClicked事件,在其中判断点击了哪个子菜单,然后添加代码做你要做的事情即可。
        </listitem>
    </orderedlist>

再去编译试试,看看能否解决问题,结果就可以了:

Aug 20, 2013 12:55:29 PM org.apache.fop.fonts.truetype.TTFFile checkTTC
INFO: Cambria Math <-- selected
Aug 20, 2013 12:55:31 PM org.apache.fop.fonts.truetype.TTFFile checkTTC
INFO: This is a TrueType collection file with 2 fonts
Aug 20, 2013 12:55:31 PM org.apache.fop.fonts.truetype.TTFFile checkTTC
INFO: Containing the following fonts:
Aug 20, 2013 12:55:31 PM org.apache.fop.fonts.truetype.TTFFile checkTTC
INFO: Cambria
Aug 20, 2013 12:55:31 PM org.apache.fop.fonts.truetype.TTFFile checkTTC
INFO: Cambria Math <-- selected

CLi@PC-CLI-1 ~/develop/docbook/books/csharp_summary/src
$

 

【总结】

此处docbook编译pdf(中间生成.fo文件)出现:

org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+

的错误的:

原因是:

此处不小心,把orderedlist的子项,写成了itemizedlist

解决办法是:

把orderedlist的子项从itemizedlist改为listitem即可。

转载请注明:在路上 » 【已解决】Docbook编译pdf出错:org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
56 queries in 0.110 seconds, using 19.12MB memory