[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] HTML heading tags issue with article
Article titles are handled by the template named 'component.title' in the component.xsl stylesheet file. There is an xsl:choose statement in there that sets the "section level", to which 1 is added to get the <h> level. That template does not properly handle article titles, which should get a section level of zero. But it is a short template and you can customize it.
I'm puzzled by some behavior I observed generating some HTML documents. The source files are articles. The article section titles seem to be coming out as I would expect - sect1 title is tagged as an h2, sect2 as an h3, etc. But the article's title itself, which the documentation clearly says should be output as an h1, is coming out as an h2. Looking at the file html/titlepage.xsl, it clearly is inserting an h1.
I had a custom spec file which doesn't do much except not show some of the things that are usually output by default:
<t:titlepage t:element="article" t:wrapper="div" class="titlepage">
I merely removed the usual set of elements inside the t:titlepage-content element, leaving just the title and subtitle, then generated my titlepage XSL from it.
My grasp of XSLT is tenuous at best, and the complexity of the cover page customization is such that my head is swimming trying to see where the h2 is coming from.
Here's what the rendered article title looks like in the output. (It also strikes me as odd that there are so many divs in there...)
<div class="article" id="idp8939920">
<h2 class="title">My article title</h2>
Any hints about how I can attack this - other than do something kludgey like give the article title a role attribute like, say,"realtitle" and use CSS to style a h2 of class"realtitle" to be a bit bigger?
Alan C. Oehler
Senior Technical Writer | Instart Logic