Skip to main content
Welcome guest. | Register | Login | Post

From DocBook to XHTML

1 reply [Last post]
ariadacapo's picture
Offline
Joined: 2006-07-13

Does anyone know how to work out the export of a DocBook document to XHTML?
I want to do this since I'm working on transferring all the GGL pages to DocBook. Specifically I have two problems:

1. Is is possible to export to XHTML 1.1 ?
Currently I am using the Conglomerate program on Ubuntu. I can export my sample XML document to HTML, but it will only generate code with deprecated tags (probably HTML 4.x) such as <b>. I can't find any way to change this.

2. Is it possible to insert XHTML tags into DocBook?
I'd like to have information as tags in the content in order to use them later with CSS. Such information would look like text text text <span class="special_part">text text text</span> text text, ie, it would not be used directly within the DocBook document, but still be exported to the XHTML file.

Any pointer / tip would be greatly appreciated... thanks!

Olivier.

Gustavo's picture
Offline
Joined: 2006-09-11
Hi, Olivier!1.- It's

Hi, Olivier!

1.- It's possible to export to (X)HTML X.X and many more. http://wiki.docbook.org/topic/DocBookOutputFormats

2.- Not inside DocBook; actually, that's the goal of this kind of languages: Contain presentation-independent data. On the other hand, it's really possible to do what you want to do:

The transition Docbook/other-formats is handle by so-called style sheets (but these are not similar to CSS). There are many existing templates (like those I've used in FSL and the Collaboration Guidelines), which you can customise or even create your own from scratch (as long as you know how to create them from scratch).

Also, if you're missing some elements that docbook doesn't supply, you can even extend docbook to add your own elements... But the resulting language won't be docbook technically (this won't be a problem at all).

So, you can edit your XHTML style-sheet to make it generate the code you wish.

On the other hand, if you're using Conglomerate to transform the docbook sources, I'd suggest you to use XSLTProc instead - it's more powerful IMHO. Install XSLTProc from your package manager and download some xstl style sheets (and extract them, of course Smiling )... Then, go to http://opensource.bureau-cornavin.com/crash-course/en/hello-world.html and do what they say, but use the second command (the first one might not work for you)... By the way, this is a good guide to learn about docbook IMO: http://opensource.bureau-cornavin.com/crash-course/en/index.html

HTH.

PS: I use Quanta to edit docbook files and I like it.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.