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: Re: Simplify HTML output for sect1 header


On Fri, 06 Jun 2008 20:25:25 +0200, Thomas Schraitle <tom_schr@web.de>  
wrote:

> [...]
>> The outer div with the class="titlepage" is fine. But why are there two
>> inner divs? As they have neither a class nor an id attribute they seem
>> to be superfluous. Wouldn't it make more sense if the XSL stylesheets
>> didn't generate them?
>
> Well, yes and no. :) They seem to be unnecessary but that's the design of
> the DocBook stylesheets. Sometimes it's just a "wrapper" for other
> content. If the content is not there, it just creates that "useless" div.
>
> As far as I remember, according to Bob, there is a "cleanup step" needed,
> if you want to get rid of these unnecessary divs.

I managed to produce a customization layer which doesn't generate  
superfluous wrapper divs. While I had to copy and customize a few  
templates the ones where I had to remove hardcoded divs were in the  
sect1.titlepage and title with mode="sect1.titlepage.recto.auto.mode".

While looking around in the XSL stylesheets I saw something like this:

<xsl:variable name="recto.content">
   <xsl:call-template name="sect1.titlepage.before.recto"/>
   <xsl:call-template name="sect1.titlepage.recto"/>
</xsl:variable>
<xsl:if test="(normalize-space($recto.content) != '') or  
($recto.elements.count &gt; 0)">
   <div><xsl:copy-of select="$recto.content"/></div>
</xsl:if>

Here the div is only printed if there is content? Is there any code to  
check if there are any attributes in an attribute set? Then the div tag in  
the following template could be printed dynamically, too:

<xsl:template match="d:title" mode="sect1.titlepage.recto.auto.mode">
   <div xsl:use-attribute-sets="sect1.titlepage.recto.style">
     <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
   </div>
</xsl:template>

As the attribute set sect1.titlepage.recto.style is empty by default that  
might be a superfluous div for many users?

> [...]If you want to get really into this matter, you can copy the  
> respective
> template into your customization layer and insert a xsl:message at the
> beginning. With the help of this element you can see if your template is
> activated or not.

Thanks, that makes finding the right templates a bit easier.

Boris

> [...]



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