Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top