我正在用 Docbook 5.0 写一些书。我将它们包括在一个集合中,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<set>
<title>The Vision Series</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="developer/devenv/devenv.xml" parse="xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="developer/system/system.xml" parse="xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="developer/application/application.xml" parse="xml" />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="developer/dom/dom.xml" parse="xml" />
</set>
为了在 html 中转换 XML,我使用了 docbook 中最新的样式表 (1.76.1)。我有一个非常定制的样式表,用于生成单个 html (mydocbook.xsl):
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../../../../bin/etc/xsl/docbook-xsl-1.76.1/html/docbook.xsl"/>
<xsl:param name="html.stylesheet" select="'books.css'"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="chunk.section.depth" select="0"/>
</xsl:stylesheet>
这工作得很好,我得到了集合、书籍和更高级别部分的 ToC,正如预期的那样。现在,按照http://www.sagehill.net/docbookxsl/ChunkingCustomization.html上的指示,我为分块版本 (mychunk.xsl) 创建了另一个样式表,如下所示:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="mydocbook.xsl"/>
<xsl:import href="../../../../bin/etc/xsl/docbook-xsl-1.76.1/html/chunk-common.xsl"/>
<xsl:include href="../../../../bin/etc/xsl/docbook-xsl-1.76.1/html/chunk-code.xsl"/>
</xsl:stylesheet>
应用此样式表时,我得到了预期的分块,但绝对没有生成ToC(集合没有 ToC,书籍没有 ToC,更高级别的部分没有 ToC)。
有人看到我做错了吗?我可以在 xsl 文件中添加消息,但我不知道在哪里添加它们来诊断问题。有关如何使用消息调试此问题的任何提示?