[XML-SIG] Maintaining catalogs
Tue, 27 Feb 2001 16:24:34 +0100
On Tue, Feb 27, 2001 at 10:11:19AM -0500, Andrew Kuchling wrote:
> For a project, I'd like to install a DTD on the system and
> automatically add its public identifier to the catalog. Is there a
> standard place to put SGML/XML catalogs on Unix systems?
> /usr/(local)?/lib/sgml? /etc/sgml/?
Debian has a package sgml-base that sets up some infrastructure for managing
SGML files. All SGML description files live in /usr/lib/sgml. The catalog
file is /etc/sgml.catalog, /usr/lib/sgml/catalog is a symlink pointing to
the real file /etc/sgml.catalog.
sgml-base contains a tool install-sgmlcatalog that's used to add and remove
entries to the catalog file. The README (see below) contains an example how
that's supposed to be done.
Guidelines for SGML packages
All SGML packages that provide a DTD or entity description file have
to depend on "sgml-base". This package installs the "install-sgmlcatalog"
script and provides the necessary directory structure.
The SGML Description Files
The location of SGML description files (DTD's, entities, etc.) is
/usr/lib/sgml . All DTD's should be installed in /usr/lib/sgml/dtd ,
all entity description files should go into /usr/lib/sgml/entities .
The SGML Catalog
The SGML catalog file is /etc/sgml.catalog , but should be refered to
through the symbolic link /usr/lib/sgml/catalog . Furthermore, all
path specifications given in the SGML catalog have to be relativ
to /usr/lib/sgml .
Please don't modify the SGML catalog directly in the postinst/postrm
scripts of your package--you should use the install-sgmlcatalog script
Here is a simple example: Consider the package "foo" which provides the
DTD foo.dtd and an entity description file "foo-general". The package
will install the following files:
The sgml.catalog file will look like this:
DOCTYPE foodoc dtd/foo.dtd
ENTITY %foo-general entities/foo-general
That's the postinst script:
install-sgmlcatalog --install /usr/lib/foo/sgml.catalog foo
and the postrm script:
install-sgmlcatalog --remove foo
Please check the install-sgmlcatalog(8) manpage for details.
Please send me an email for bugs/suggestions/critics on these guidelines.
May 8, 1997
Christian Schwarz <email@example.com>