我有一个 DocBook5 文档,它使用 xsltproc 渲染成块 HTML 就好了。
我现在正在尝试渲染为 PDF,但在 fo 输出阶段,xsltproc 给了我:
Element step in namespace 'http://docbook.org/ns/docbook' encountered in sidebar, but no template matches.
如果我尝试使用 fop 渲染生成的 fo,确实,xsltproc 似乎忽略了侧边栏中任何过程中的步骤,因为 fop 在第一个过程中阻塞:
...pdf/book.fo:9:1597: Error(9/1597): fo:list-block is missing child elements.
Required Content Model: marker* (list-item)+
为什么 xsltproc 在涉及分块 HTML 时不关心这一点,但对 fo 却不喜欢这个?
更新:似乎是样式表发出了这条消息:
$ cat /usr/share/sgml/docbook/xsl-ns-stylesheets-1.75.2/fo/docbook.xsl | grep -B 15 "but no template matches"
<xsl:key name="id" match="*" use="@id|@xml:id"/>
<!-- ==================================================================== -->
<xsl:template match="*">
<xsl:message>
<xsl:text>Element </xsl:text>
<xsl:value-of select="local-name(.)"/>
<xsl:text> in namespace '</xsl:text>
<xsl:value-of select="namespace-uri(.)"/>
<xsl:text>' encountered</xsl:text>
<xsl:if test="parent::*">
<xsl:text> in </xsl:text>
<xsl:value-of select="name(parent::*)"/>
</xsl:if>
<xsl:text>, but no template matches.</xsl:text>