[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] HTML heading tags issue with article
Hi Alan,
Close, but you want to use this test instead:
<xsl:when test="$node/self::article">0</xsl:when>
The context node for this template is title, but the $node
param contains the parent element of the title, so that is why self::article
would work here. The parent::book syntax is used to select all *children*
of a book, which gives h1 to chapter titles and such. From: Alan Oehler
Sent: Tuesday, July 16, 2013 3:54 PM
To: Bob Stayton
Cc: docbook-apps
Subject: Re: [docbook-apps] HTML heading tags issue with
article Hmmm... looks like it should be easy, but I've had no luck.
Here's the code you referred to:
<xsl:variable name="level">
<xsl:choose>
<!-- chapters and other book children should get
<h1> -->
<xsl:when
test="$node/parent::book">0</xsl:when>
<xsl:when test="ancestor::section">
<xsl:value-of
select="count(ancestor::section)+1"/>
</xsl:when>
<xsl:when
test="ancestor::sect5">6</xsl:when>
<xsl:when
test="ancestor::sect4">5</xsl:when>
<xsl:when
test="ancestor::sect3">4</xsl:when>
<xsl:when
test="ancestor::sect2">3</xsl:when>
<xsl:when
test="ancestor::sect1">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:variable> I added a line
<xsl:when
test="$node/parent::article">0</xsl:when> after the similar line with "book," but it had no apparent effect on the
output.
Alan
On Tue, Jul 16, 2013 at 1:14 PM, Alan Oehler <aoehler@instartlogic.com> wrote:
Alan C. Oehler
Senior Technical Writer | Instart Logic
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]