This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: When to use fo/component.xsl


On Wed, Nov 13, 2002 at 12:10:29PM +0100, Jens Stavnstrup wrote:
> 
> In the book "DocBook: The Definitive Guide", components are defined as 
> "the chapter-like elements of a book". Among these elements are preface, 
> chapter, appendix and bibliography etc.
> 
> When a book is processed, the template "component.title" in 
> fo/component.xsl is called to generate the titlepage for each component.
> 
> To my big suprise apparently not only components are using this template:
> 
> If we print out the name of each node calling this template, we get 
> the following result:
> 
> 
> assumed            actual
> node-type          name() of node
> ---------          --------------
> preface            preface
> chapter            title
> appendix           title
> bibliography       bibliography
> 
> 
> 
> It seem to me, that there is some assymetry here. Note, the stylessheets 
> works just as expected, so I do not consider this a bug, but ...

That's Norm's flexible programming style.  Although some
templates in titlepage.templates.xsl that match on a
particular "title" will call component.title, they include a
parameter to select the title's parent:

<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
...
<xsl:call-template name="component.title">
  <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
</xsl:call-template>

If not called with that param, then it must be called
by the component element's template and the default
node="." is used.

So the component.title template is always working with
$node set to the component element, not the title element.
If not, then it is a bug.

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]