문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top