没有Abbrev标签的DocBook 5呈现 [英] DocBook 5 rendering without abbrev tag
问题描述
我的DocBook 5文档包含 glossentry
标记,其中包含abbrev
标签. abbrev
标记似乎对渲染的HTML毫无贡献.我是DocBook和XSLT的新手.我需要从哪里着手改变呢?我一直在浏览文档,除了对这显然是默认行为感到惊讶之外,我不确定要在哪里查找问题排查方法.
My DocBook 5 document contains glossentry
tags that contain abbrev
tags. The abbrev
tags do not seem to contribute anything whatsoever to the rendered HTML. I'm new to DocBook and XSLT. Where do I need to start looking to change this? I've been looking through the docs and aside from being surprised by this apparently being the default behaviour, I'm not sure where to look next to troubleshoot.
设置:我的DocBook文件仅以<book xmlns:xl="http://www.w3.org/1999/xlink">
开头.我只将xsltproc
指向单个XSL文件,该文件包含以下内容:
Setup: My DocBook file starts simply with <book xmlns:xl="http://www.w3.org/1999/xlink">
. I point xsltproc
only to a single XSL file, which contains exactly this:
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl"/>
<xsl:output method="html"
encoding="UTF-8"
indent="no"/>
<xsl:param name="html.stylesheet" select="'main.css'"/>
<xsl:param name="generate.toc">
book toc,title
</xsl:param>
<xsl:param name="glossentry.show.acronym">yes</xsl:param>
</xsl:stylesheet>
推荐答案
有一个名为glossentry.show.acronym
的参数,您可以将其设置为yes
,以确保"entryentry"中的"acronym
和abbrev
元素"均显示.您还可以将其设置为primary
,以确保这些元素显示为条目的主要文本.
There is a parameter named glossentry.show.acronym
that you can set to yes
to ensure both "acronym
and abbrev
elements in the glossentry" are displayed. You can also set it to primary
to ensure these elements are displayed as the primary text for an entry.
如果需要更多自定义,则需要添加自己的模板来覆盖Docbook样式表中的模板,该模板是
If you need more customization, you would need to add your own template overriding the one in the Docbook stylesheet, which is
<xsl:template match="d:glossentry/d:abbrev"> <xsl:apply-templates/> <xsl:if test="following-sibling::d:acronym|following-sibling::d:abbrev">, </xsl:if> </xsl:template>
并将abbrev
元素输出为逗号分隔的列表.
and outputs the abbrev
elements as a comma separated list.
这篇关于没有Abbrev标签的DocBook 5呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!