我正在使用1.77xsl转换将docbook转换为html。但当它被转换时,它会自动生成一个目录。您如何更改此行为?
我找到了这个:Disable table of contents for documents
所以我猜html xsl转换应该是表示系统?
发布于 2012-07-28 05:36:48
可以使用xsl样式表对复杂的DocBook格式进行自定义。
另请参阅
Writing a DocBOok Customization Layer for Formatting
Customizing Table Of Contents Using XSL
customize_formatting.xsl:示例DocBook XSL定制层
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0"> <!-- change this to 2.0 if your tools support it -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<!--uncomment this to suppress toc when using XSL 1.0 or 2.0
<xsl:param name="generate.toc">article</xsl:param>
<xsl:param name="generate.toc">book</xsl:param>
-->
<!--uncomment this to suppress toc when using XSL 2.0
<xsl:param name="generate.toc">
article nop
book nop
</xsl:param>
-->
</xsl:stylesheet>如何使用customize_formatting.xsl
让您的工具使用customize_formatting.xsl,而不是现成的docbook.xsl。然后,将所有格式定制放在<xsl:stylesheet>部分的主体中。
对于TOC取消,只需取消相应行的注释即可。
一些(或所有)XSL1.0工具有一个奇怪的地方,它似乎阻止它们处理<xsl:param name="generate.toc">主体中使用的以空格分隔的对。我已经成功地通过使用单个单词article或book而不是适当的空格分隔对来抑制总目录。
发布于 2012-07-17 06:24:16
在转换时,您可以使用Transformer#setParameter(String, Object)方法指定不生成目录,如下所示:
transformer.setParameter("generate.toc", "nop");https://stackoverflow.com/questions/11513273
复制相似问题