OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: Re: DOCBOOK: Help with chapter headings in conversion to HTML

> From: Derek Dees <djdees@mm.com>
> I've spent some time digging, but have gotten lost. What I'm trying to do 
> is get the style sheet to quit printing Chapter, the number and the chapter 
> title at the start of each chapter in the document.
> For example:
> What I'm getting:
>          Chapter 1. Title here
> What I want:
>          1. Title here
> I found in html/component.xsl where that is defined, but then get lost 
> following the <xsl:apply-templates select="$node" 
> mode="object.title.markup"/> to see what is doing the work.

No doubt it is difficult to trace the series of steps in
which titles like this are handled.  The complexity is due
to the remarkable flexibility that Norm programmed into the
stylesheets for handling localization and customization.
Fortuantely, he made applying customizations easy.

Generated text like titles and cross references
come from text templates defined for each language,
in files like common/en.xml.  The stylesheets are
set up to accept local substitutes for particular
templates.  This driver file does what you 
want (assuming this is just for English):

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:import href="../docbook-xsl-1.44/html/docbook.xsl"/>
<xsl:param name="local.l10n.xml" select="document('')"/>
<i18n xmlns="http://docbook.sourceforge.net/xmlns/l10n/1.0">
  <l10n language="en">
    <context name="title">
      <template name="chapter" text="%n. %t"/>

The <context> element indicates that you want a
new template for handling the title.  The <template>
element (this is not an <xsl:template> BTW) indicates
the text to use for the specified element name.
In the text templates, '%n' resolves to the
number, and '%t' resolves to the title.
There is also a '%s' for subtitle.

I'm writing up stuff like this for inclusion in a
new version of the chapter in Norm's book on
processing DocBook with XSL stylesheets.

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC