tags:

views:

17

answers:

1

Dear all,

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

+1  A: 

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.

Oded
Thank you for your answer this worked like a charm.
Jerry Jacobs