Docbook notes (again)
Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 14 August 2003 08:58, Jean Jordaan wrote: > That article also references this one, which sounds good, > and apropos for non-XML-fans ;) but which flaky DNS here > doesn't let me see at the moment: > > Take My Advice: Don't Learn XML -- excellent introduction > to DocBook and structured authoring by Michael Smith. That one is at http://xml.oreilly.com/news/dontlearn_0701.html, and references Lauri's KDE docbook guide which I already promoted here. Yay. It's not so much an introduction to docbook as a statement that you should concentrate on learning the needed tools, not some random technology associated with the tool. In order to transform Docbook to something else, you'll need xsltproc. This can be provided by a libxslt package (/usr/ports/textproc/libxslt/ or obtained from the GNOME site). This will drag in libxml2 (again, in ports or from the GNOME site). Next, you need the Docbook DTD and XSL files. These can be obtained from the Docbook site, or are included with most KDE installations. As a convenience, I've tarred them up and put them up at http://www.cs.kun.nl/~adridg/docbook.tgz (290kb). The tarball unpacks a ./README.kde, along with directories xml-dtd-4.1.2/ and xsl/. It doesn't really matter where you put this stuff - /usr/local/share/docbook might be a good spot. I usually drop it in /tmp/docbook when I need it separately. Call the place where this tarball is unpacked $DOCBOOK_PREFIX. Next up, to convert XML docbook (say, exec.sgml) to HTML, you need to call xsltproc as follows: SGML_CATALOG_FILES=$DOCBOOK_PREFIX/xml-dtd-4.1.2/docbook.cat STYLESHEET=$DOCBOOK_PREFIX/xsl/html/chunk.xsl export SGML_CATALOG_FILES xsltproc --catalogs $STYLESHEET exec.sgml The required XML tag is <?xml version="1.0" ?> while the DOCTYPE tag is <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "dtd/docbookx.dtd" If you use the wrong DOCTYPE tag, you get a warning and the document is not checked against the DTD. -- pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[email protected]> Key fingerprint = 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01