Docbook-xslt 章节 ID 匹配

发布于 2024-08-29 04:27:29 字数 312 浏览 1 评论 0原文

我想编写一个 xslt 规则,如果它与某个章节 ID 匹配,它将在该部分上将 autolabel 设置为零。

在伪代码中:

IF CHAPTER == LOGBOOK
    SECTION.AUTOLABEL = 0
ELSE
    SECTION.AUTOLABEL = 1
ENDIF

但是在阅读了 docbook xsl 网站和 docbook xsl 参考之后,我仍然无法弄清楚如何做到这一点。 也许有人可以把我推向正确的方向,因为我是 docbook 和 xls(t) 的新手

亲切的问候, 杰瑞

I would like to write a xslt rule if it matches a certain chapter ID that it sets autolabel to zero on the section.

in pseudo code:

IF CHAPTER == LOGBOOK
    SECTION.AUTOLABEL = 0
ELSE
    SECTION.AUTOLABEL = 1
ENDIF

But after reading the docbook xsl website and docbook xsl reference i'm still unable to figure out how to do it.
Maybe someone can push me in the right direction, because i'm new in docbook and xls(t)

Kind regards,
Jerry

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄傲 2024-09-05 04:27:29

您需要使用 xsl:when 来测试条件。

 <xsl:choose>
  <xsl:when test="chapter = logbook">0</xsl:when>
  <xsl:otherwise>1</xsl:otherwise>
</xsl:choose>

这假设当前节点有一个 chapterlogbook 子节点。

You need to use xsl:when to test conditions.

 <xsl:choose>
  <xsl:when test="chapter = logbook">0</xsl:when>
  <xsl:otherwise>1</xsl:otherwise>
</xsl:choose>

This assumes that the current node has a chapter and logbook child nodes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文