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


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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

Subject: Re: [docbook] how do i get a common parent with a unique id?

[moving this over to the docbook-apps mailing list where such topics are 

I think when Norm Walsh designed the nested div elements in the titlepage 
mechanism for HTML, he was allowing for customization of attributes at each 
level of nesting.  But since most people don't do such customization with 
XSL (they use CSS instead), then they become a lot of baggage.  This 
customization trims down section output a bit:

<xsl:template name="section.titlepage">
  <xsl:call-template name="section.titlepage.before.recto"/>
  <xsl:call-template name="section.titlepage.recto"/>
  <xsl:call-template name="section.titlepage.before.verso"/>
  <xsl:call-template name="section.titlepage.verso"/>
  <xsl:call-template name="section.titlepage.separator"/>

<xsl:template match="section" mode="class.attribute">
  <xsl:attribute name="id">
    <xsl:call-template name="object.id"/>

<xsl:template match="title" mode="section.titlepage.recto.auto.mode">
  <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>

The first template is a copy of the section.titlepage template from the 
generated html/titlepage.templates.xsl file, but stripped down to 

The second template puts the id on the outer div element, instead of on the 
title div.

The last one eliminates the extra div around the h2.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Anthony Ettinger" <anthony@chovy.com>
To: <docbook@lists.oasis-open.org>
Sent: Tuesday, November 13, 2007 2:33 PM
Subject: [docbook] how do i get a common parent with a unique id?

>I dont' much care for the <section><title>...</title></section> html
> that is output...all I really need is to a unqiue id on an html tag
> with the content as children.
> something like would suffice:
> <div id="foo">
>  <h2>Title</h2>
>  <p>My paragraphs</p>
>  <p>My paragraphs</p>
> </div>
> I have come to a block in my quest of customizing <title> markup as
> explained here: http://www.sagehill.net/docbookxsl/HTMLTitlePage.html
> The template/titlepage.xsl is not obvious to me, other than declaring
> a bunch of parameters, used elsewhere...how it is generating:
> <div class="titlepage">
>  <div>
>    <div>
>      <a name="foo"></a><h2>Title</h2>
>    </div>
>  </div>
>  <p>My paragaphs</p>
> </div>
> -- 
> Anthony Ettinger
> Ph: 408-656-2473
> var (bonita, farley) = new Dog;
> farley.barks("very loud");
> bonita.barks("at strangers");
> http://chovy.dyndns.org/resume/
> http://utuxia.com/consulting
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-help@lists.oasis-open.org

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