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


Hi,

On Freitag, 6. Juni 2008, Boris wrote:
> [...]
> >> 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.

Great! :-)


> 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 :).

Ahh, ok. Well, if this is the "only" reason, wouldn't it be better 
to "convert" your old CSS to the new style? Maybe start with some easy 
rules and add more step by step.

I don't know if this works for you. Maybe it's easier than playing around 
with programs or stylesheets to get a more simplified HTML.
A plus: You can use your new CSS to every generated HTML from DocBook, 
even for documents not written by you.


> >> How do I get rid of the many div elements? [...]
> >
> > 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?

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. 


> > 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.

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.
Another solution would be to use a XSLT debugger. I think Emacs has one, 
but I never used it.


> > 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?

I found another thread, regarding simpler (X)HTML:

http://lists.oasis-open.org/archives/docbook-apps/200504/msg00228.html


Tom

-- 
Thomas Schraitle


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