A few tips about using XML catalogs on Cygwin -
- if you already have the Cygwin "docbook-xsl" and "docbook-xml42"
packages installed via the Cygwin setup app, you already have a
catalog at /etc/xml/catalog (those packages install and update it)
- there's a small problem in the catalog entry that the current
(v1.65.1) docbook-xsl package installs; the problem is, it has:
But it should have this:
You can fix that by running this command:
xmlcatalog --noout --add rewriteURI \
http://docbook.sourceforge.net/release/xsl/current/ \
/usr/share/docbook-xsl/ \
/etc/xml/catalog
- once you've made that fix, if you use xsltproc, you don't need to do
any additional config to enable catalog support for DocBook docs;
just, if you have "local" URIs like href="/usr/local/share/xsl/..."
in a stylesheet customization layer or whatever, replace them with
href="http://docbook.sourceforge.net/release/xsl/current/";
- if you're using Saxon or another Java-based XSLT engine, your engine
won't understand the pathnames in your /etc/xml/catalog file --
because java is a native Windows app, not (yet) complied for
Cygwin; so there are a few more steps:
- create a separate "Windows" catalog file; run the following
commands:
xmlcatalog --create > /etc/xml/catalog-windows
xmlcatalog --noout --add rewriteURI \
http://docbook.sourceforge.net/release/xsl/current/ \
c:/cygwin/usr/share/docbook-xsl/ \
/etc/xml/catalog-windows
xmlcatalog --noout --add rewriteSystem \
http://www.oasis-open.org/docbook/xml/4.2/ \
c:/cygwin/usr/share/docbook-xml42/ \
/etc/xml/catalog-windows
(if your cygwin root isn't in the default "c:/cygwin" location,
of course change that bit to whatever matches your Cygwin install)
- to tell the xml-commons resolver where to find the catalog, you
need to install a CatalogManager.properties file; do this:
mkdir -p /etc/java/resolver
cd /etc/java/resolver
wget http://xml.apache.org/commons/components/resolver/CatalogManager.properties
mv CatalogManager.properties CatalogManager.properties.old
sed 's#^catalogs=.\+$#catalogs=c:/cygwin/etc/xml/catalog#; s#^verbosity=.\+$#verbosity=1#' \
CatalogManager.properties.old > CatalogManager.properties
Then you'll need to make sure to add "c:/cygwin/etc/java/resolver/"
to your Java classpath, either via the CLASSPATH environment
variable, or the java -cp option (note: the resolver needs the
*directory* name -- not the CatalogManager.properties filename;
don't put "c:/cygwin/etc/java/resolver/CatalogManager.properties"
From there on, just follow the instructions in Bob's book -
http://sagehill.net/docbookxsl/UseCatalog.html#UsingCatalogsSaxon