Appendix A. Installation

Table of Contents
Installing the DocBook DTD
Installing Jade
Installing the ModularDocBook Stylesheets

Installing the DocBook DTD

This appendix describes how to install the DocBook DTD on your system so that popular command-line tools like SP can use it. If you are installing DocBook for use with a commercial application, consult the documentation for your application as well.

This appendix describes the installation of DocBook V3.1. If you are using another distribution, the process should be about the same, but there may be minor differences. DocBook V3.1 is backward compatible with DocBook V3.0, and is the recommended distribution at the time of this writing.

Unpacking the DocBook V3.1 Distribution

DocBook is distributed on the DocBook web site. You will also find a copy of the distribution on the CD-ROM.

The distribution consists of 14 files:

31chg.txt Describes the changes in DocBook V3.1 from the preceding version (3.0)
40issues.txt Summarizes backwards-incompatible changes planned for DocBook V4.0
50issues.txt Summarizes backwards-incompatible changes planned for DocBook V5.0
cals-tbl.dtd The CALS Table Model DTD
ChangeLog A GNU-style ChangeLog summarizing the individual edits made on each file in the distribution since V3.0.
dbcent.mod The character entity module
dbgenent.mod The general entity module
dbhier.mod The document hierarchy module
dbnotn.mod The notations module
dbpool.mod The information pool module
docbook.cat A sample OASIS catalog for DocBook
docbook.dcl An SGML Declaration suitable for DocBook
docbook.dtd The DocBook DTD
readme.txt The DocBook V3.1 "readme" file

Unpack the distribution into a directory on your system. The exact location is irrelevant. On UNIX systems it's common to put it somewhere under /usr/local or /share (for example, /usr/local/sgml/docbook or /share/sgml/docbook). On a PC, perhaps c:\sgml\docbook.

Getting the ISO Entity Sets

DocBook refers to a number of standard entity sets that are not distributed with DocBook. (They aren't distributed with DocBook because they aren't maintained by the DocBook TC. They're maintained by ISO.) If you've installed other SGML DTDs or tools, they may already be on your system.

If you are missing some of them, they are available from Robin Cover's pages at OASIS: http://www.oasis-open.org/cover/ISOEnts.zip.[1] See http://www.oasis-open.org/cover/topics.html#entities for more information.

The DocBook Catalog

DocBook uses public identifiers to refer to its constituent parts. In some sense, DocBook is DocBook because it has the formal public identifier "-//OASIS//DTD DocBook V3.1//EN". In order for tools on your system to find your locally installed copy of DocBook, you must map these public identifiers into system identifiers, i.e., filenames, on your system. For a complete discussion of catalog files, see the Section called Public Identifiers, System Identifiers, and Catalog Files in Chapter 2.

The DocBook distribution includes a sample catalog, docbook.cat , which provides a mapping for all of the public identifiers referenced by DocBook. This mapping won't work "out of the box" for two reasons: first, your tools won't be able to find it, and second, the mappings for the ISO entity sets probably don't point to the right place on your system.

Finding the Catalog

If you've already got some other SGML DTDs installed, you probably already have a catalog file. In this case, the easiest thing to do is append the DocBook catalog entries to the end of your existing catalog and then change them to point to the files on your system.

If DocBook is the first DTD that you're installing, make a copy of docbook.cat and call it catalog. Put this file in a higher-level directory and edit the relative pathnames that it contains to point to the actual locations of the files on your system. For example, if you installed DocBook in /share/sgml/docbk30/, put the catalog in /share/sgml/.

In order for applications to find your catalog file(s), you may have to change the application preferences or set an environment variable. For SP and Jade, set the environment variable SGML_CATALOG_FILES to the delimited list of catalog filenames. On my system, this looks like:

SGML_CATALOG_FILES=./catalog;n:/share/sgml/catalog;n:/adept80/doctypes/catalog.jade;j:/jade/catalog

(On a UNIX machine, use colons instead of semicolons to delimit the filenames.)

If you don't wish to set the environment variable, you can explicitly pass the name of each catalog to the SP application with the -c option, like this:

nsgmls -c ./catalog -c n:/share/sgml/catalog -c othercatalogs
 ...

Fixing the Catalog

The basic format of each entry in the DocBook catalog is:

PUBLIC "some public id" "some filename"

What you have to do is change each of the "some filenames" to point to the actual name of the file on your system.

Note

Filenames should be supplied using absolute filenames, or paths relative to the location of the catalog file.

To continue with the example above, let's say that you've got:

  • DocBook in /share/sgml/docbk30/,

  • The ISO entities in /share/sgml/entities/8879/, and

  • Your catalog in /share/sgml/catalog

Then you would change the catalog entry for the DTD to be:

PUBLIC "-//OASIS//DTD DocBook V3.1//EN" "docbk30/docbook.dtd"

You would change the catalog entry for the general technical character entities to:

PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "entities/8879/iso-tech.gml"

And similarly for the other public identifiers used by DocBook. In each case, the filename specified for the public identifier should be the name of the file on your system, specified as an absolute filename, or relative to the location of the catalog in which it occurs.

Mapping System Identifiers for XML

Since XML documents are required to have system identifiers, but are not required to have public identifiers, it's likely that some of the documents you want to process will only have system identifiers.

It turns out that you can still take advantage of the catalog in this case. The SYSTEM directive allows you to map the system identifier used in the document to the actual location on your system.

Suppose that you work with a colleague who uses the system identifier "file:///c:/sgml/db3xml/db3xml.dtd" to identify the XML version of DocBook on her system. On your system, you want to map that to "/share/sgml/db3xml/db3xml.dtd". The following entry in your catalog will do the trick:


SYSTEM "http://docbook.org/docbook/xml/1.4/db3xml.dtd" "/share/sgml/db3xml/db3xml.dtd"

Unfortunately, this technique only works with applications that read and understand catalog files.

Testing Your Installation

The best way to test your installation is with a simple command-line parser like nsgmls from SP. Create a small test document, like this:

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<chapter><title>Test Chapter</title>
<para>
This is a test document.
</para>
</chapter>

and run the following command:

nsgmls -sv test.sgm

If the nsgmls command produces errors, review your catalog and resolve the errors. You can ignore warnings about DTDDECL being unsupported. It is unsupported, and there's no way to disable the warning message. Note, however, that this may also affect which SGML declaration gets used. When in doubt, pass the correct declaration explicitly and see if that corrects any problems. (To parse test.sgm with the declaration docbook.dcl explicitly, run nsgmls -sv docbook.dcl test.sgm.)

For some suggestions about how to work around these problems in SP and Jade, see the next section, the Section called Installing Jade.

Notes

[1]

The names of the entity files in this distribution do not exactly match the names of the files used in the catalog file distributed with DocBook (docbook.cat). Make sure your catalog file points to the right files.