Validating docbook articles...

Dag-Erling Smørgrav des at des.no
Mon Feb 23 20:27:24 UTC 2004


Chuck Swiger <cswiger at mac.com> writes:
> How does one generate proper SystemLiterals per:
> [...]
> Are these entities published via a URI, or does one need to refer to a
> local path?

The system literal can be anything as long as you have a catalog that
reveals the real location of the external entity.  The usual practice
for entities that rarely change is to create an online repository and
let the system literal point to that.  In this case though you might
as well use an empty or intentionally meaningless string.

You'll want to generate a catalog that looks like this:

<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE catalog PUBLIC '-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN'
    'http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd'>
<catalog xmlns='urn:oasis:names:tc:entity:xmlns:xml:catalog'>
  <nextCatalog catalog='/usr/local/share/xml/catalog'/>
  <public publicId='-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN'
    uri='file:///path/to/manpages.ent'/>
  <!-- ... -->
</catalog>

and set the XML_CATALOG_FILES environment variable to point to it.
although this is not documented in the xmllint man page, it is
documented in the xsltproc manual page and I believe that xmllint
understands it too (since they both use libxml2 to parse and validate
XML)

As a stopgap measure, xmllint and xsltproc understand SGML catalogs
and will obey the SGML_CATALOG_FILES environment variable when invoked
with the --catalogs option.


DES
-- 
Dag-Erling Smørgrav - des at des.no



More information about the freebsd-doc mailing list