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: Set different names for Window title bar,TOC andchunked files


On Tue, Jan 07, 2003 at 12:46:22PM +0100, Xyvind Heggen wrote:
> What I want to do is set seperate names to appear in the Index(TOC) and
> on the pop up window when using chunks. I'm creating a huge xml file
> divided into several chapters and sub chapter so that when parsed it
> creates 40 somthing html files.
> 
> Here's the problem : I set the xsl file to use the chapter/sect name as
> the title for the created html file and the TOC inputs.

I want to clarify some terminology here so I can be sure
I'm answering your question.  The filename of a chunk comes
from the id attribute of the element that generated the chunk,
if you set the use.id.as.filename parameter, which I
presume is what you meant.  The filename doesn't come from
the <title> of the section element.

But the element's <title>, not the id, *is* used in the section's
displayed name in the TOC.

> Offcourse with
> different names for each file. The file names of the respective created
> html files is shown on the window title bar.

The window titlebar should not be showing the filename,
it should be showing the HTML <TITLE> element from the
file's <HEAD> element.  In DocBook output, the TITLE
element contains the <title> from the element that generated
the chunk.  If your browser is indeed showing the HTML
filename, then there is something wrong with the browser.

> However, I wish to have one
> single name (of my choice) shown on the title bar instead. The same name
> to be shown on the window title bar for all the files instead of their
> "real" name, at the same time as I want their "real" names to show in
> the TOC.

Changing the content of TITLE in DocBook XSL is possible,
but not easy.  There is no parameter for this, I think
because most people would not want to do this.  It messes
up browser bookmarks to have all the files with the same TITLE.  

If you want to do this, you have to copy the template named
'head.content' from html/docbook.xsl to a stylesheet customization
layer (see the FAQ), and modify it at the top. 

Change:

<xsl:template name="head.content">
  <xsl:param name="node" select="."/>
  <xsl:param name="title">
    <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
  </xsl:param>

to:

<xsl:template name="head.content">
  <xsl:param name="node" select="."/>
  <xsl:param name="title">
    <xsl:value-of select="$my.title.parameter"/>  <!-- changed line -->
  </xsl:param>

And then pass the parameter 'my.title.parameter' with
your title in it at processing time.

The risk of this kind of customization is that the
head.content template is pretty large, and there is a good
chance it will change with future stylesheet releases.
So you might have to keep up with updating it in
your customization layer.


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]