Re: [docbook-apps] Possible <Glossary>/<Subtitle> bug?

From
Bob Stayton <>
Date
2004-02-12T17:50:28+00:00
ID
057001c3f192$58e30ca0$2dfc9384@toshiro
Thread
Re: [docbook-apps] Possible <Glossary>/<Subtitle> bug?
Unfortunately, what you are seeing is some obsolete 
code that should

be removed.  The component.title.mode is no 
longer used by

the stylesheets.  It was replaced by the 
titlepage mechanism that

uses the titlepage.templates.xml specification 
file.  I'll see about

removing the obsolete code.

 

In fact, the glossary subtitle is being handled 
by the default template for

subtitle in mode='titlepage.mode'.  This 
template is in xhtml/titlepage.xsl:

 

<xsl:template match="subtitle" 
mode="titlepage.mode">
  <h2 
class="{name(.)}">
    <xsl:apply-templates 
mode="titlepage.mode"/>
  
</h2>
</xsl:template>

 

If you want something different for a glossary 
subtitle, you can add a

template like this to your customization 
layer:

 

<xsl:template match="subtitle" 
mode="glossary.recto.titlepage.mode">
  <h3 
class="{name(.)}">
    <xsl:apply-templates 
mode="titlepage.mode"/>
  
</h3>
</xsl:template>

 

This template uses the mode specific to glossary 
title pages. The

sequence of modes used in titlepages is described 
in:

 

http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#d0e10008

 

You could also change the style of the h2 using a 
CSS stylesheet

associated with your HTML pages.

 

Bob Stayton
Sagehill Enterprises
DocBook 
Consulting


 

 

  
----- Original Message ----- 

  
From: 
   
  

  
To:  
  

  
Sent: Thursday, February 12, 2004 9:01 
  AM

  
Subject: [docbook-apps] Possible 
  <Glossary>/<Subtitle> bug?

  

I'm experiencing some odd 
  behaviour with the XHTML Stylesheets when processing Glossarys. 
  

For example: 

<glossary> 
  <title>A Glossary</title> 
  <subtitle>subby 
  gloss</subtitle> 
... 
  
</glossary> 

outputs: 

<div> 
  <h2 
  xmlns="http://www.w3.org/1999/xhtml" 
  class="title"><a ...></a>A Glossary</h2> 
</div> 
<div> 
  <h2 
  xmlns="http://www.w3.org/1999/xhtml" 
  class="subtitle">subby gloss</h2> 
</div> 

Glossary.xml (from the latest full release) provides: 
  

<!-- 
  ******************************************************************** 
  
     $Id: glossary.xsl,v 1.15 2003/02/28 
  16:44:35 bobstayton Exp $ 
    
   ******************************************************************** 
  
... 
<xsl:template match="glossary/title" 
  mode="component.title.mode"> 
  <h2 
  xmlns="http://www.w3.org/1999/xhtml"> 
    <xsl:apply-templates/> 
  </h2> 
</xsl:template> 

<xsl:template match="glossary/subtitle" 
  mode="component.title.mode"> 
  <h3 
  xmlns="http://www.w3.org/1999/xhtml"> 
    
  <i><xsl:apply-templates/></i> 
  </h3> 
</xsl:template> 

I can see that match="glossary/title" 
  is working as expected to produce my <h2>s but for some reason 
  match="glossary/subtitle" isn't getting called to produce my <h3>s - I 
  get another <h2>... 

Am I 
  understanding the XSL correctly or is there actually something wrong? There's 
  nothing outstanding on the Sourceforge bug tracker... 

TIA 

Mart