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


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

Hi Thomas,

> On Freitag, 6. Juni 2008, Boris wrote:
>> I'm writing my first customization layer trying to simplify the HTML
>> output for a sect1 header. By default I get:
>>
>> <div class="titlepage"><div><div><h2 class="title" style="clear:
>> both"><a name="id4699187"></a>1.1. Foo</h2></div></div></div>
>>
>> However I need something really simple like:
>>
>> <h2 class="title">1.1. Foo</h2>
>
> Is there any special reason why you need this?

I have some HTML books which I started to convert to DocBook XML files. As  
there are various CSS stylesheets used I'd be happy if I can continue to  
use them for now (the conversion is already enough work :).

>> How do I get rid of the many div elements? Do I need to look at
>> html/sections.xsl or html/titlepage.xsl? And do I need to create a
>> titlepage spec file (I hope there is an easier way to do something as
>> simple)?
>
> The div elements are usually used to customize your HTML with CSS. They
> contain useful information, like "titlepage" in your above case.

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?

> For this reason, divs comes from a lot of templates and I don't think it
> is really easy to remove them. I suppose you would need to customize
> almost everything which is probably a rewrite of the complete
> stylesheets.

I started to look around and know now that the div tag with  
class="titlepage" is generated by the template sect1.titlepage in  
html/titlepage.templates.xsl. However I haven't figured out yet what is  
generating the two inner divs.

> However, if you need really such a simplified output, you could write a
> XSLT stylesheet which reads in the input generated from the DocBook
> stylesheets and outputs a simplified HTML version. Maybe this is a bit
> easier. Make sure you use the XHTML version to be XML compliant.

You are right. Maybe I can use a program which cleans up the HTML code and  
removes duplicate tags. However I still wonder if it's right at all to  
generate two "empty" divs here?

Boris



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