2009年11月30日 星期一

Docbook on Linux

A Note of DocBook XML Env Setup

A Note of DocBook XML Env Setup

Da-Juan Chou

Abstract


This is a note for DocBook XML

This is a note for DocBook XML environment setup.


Tools

The tools I used to produce and transform XML document includes

  • OASIS DocBook DTD

  • DSSSL style sheet

  • XSL style sheet

Install DocBook DTD

If you are using Fedora Core2 with apt
installed, run the following commands:


#apt-get install docbook-dtd

If you are using debian Linux run the following commands ...


#apt-get install docbook docbook-xml

Install DSSSL style sheet

If you are using Fedora Core2 with apt
installed, run the following commands:


#apt-get install docbook-style-dsssl

If you are using debian Linux run the following commands ...


#apt-get install docbook-dsssl

Install XSL style sheet

If you are using Fedora Core2 with apt
installed, run the following commands:


#apt-get install docbook-style-xsl
#apt-get install libxslt
#apt-get install libxml
#apt-get install libxml2

If you are using debian Linux run the following commands ...


#apt-get install docbook-xsl ldp-docbook-xsl
#apt-get install libxslt1 libxml2
#apt-get install xsltproc

Use xsltproc transform documents

I am only a rookie of DocBook, I choose to use xslproc to transform XML file to the
format I want. There is no special reason. I made the choice just because it seems to me
the most easy way to do that.

You can run the following commands to validate your XML document


$xmllint --valid --noout in.xml

Run the following command to transform XML document to a
single HTML file:


$xsltproc -o output.html $STYLESHEET_FILE in.xml

Note

$STYLESHEET is a file with name docbook.xsl. In my system, it is
/usr/share/sgml/docbook/xsl-stylesheets-1.65.1-1/html/docbook.xsl

If you want to output a segmented HTML document, run the following commands:


$xsltproc $STYLESHEET_FILE_CHUNK in.xml

Note

$STYLESHEET_FILE_CHUNK is a file with name chunk.xsl.
In my system, it is /usr/share/sgml/docbook/xsl-stylesheets-1.65.1-1/html/chunk.xsl

Resources

There are a lot of links and HOWTOs that may help

LDP author site


Installing and Using DocBook


DocBook Demystification HOWTO

DocBook: The Definitive Guide


Single Source Publishing with DocBook XML

You can download a Sample HOWTO
from LDP or download xml source of HOWTO from
LDP CVS of DocBook

Here is a good chinese TLDP-HOWTO.
The document contains lots useful informations including Traditional Chinese Support.


沒有留言:

張貼留言