I found it not straightforward to download a wanted archive of dtds. Sometimes it's easy to get a single dtd file, but it needs a dozen of other files with it, so an archive is the only reasonable solution. If you know a good place to get archives from, post it here.
Catalog files come in 2 formats:
- SGML catalog is a text file, usually named catalog without extension. Entries are like:
Kod: Zaznacz cały
PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd"
- XML catalog is an xml file, starting from:
Kod: Zaznacz cały
<?xml version='1.0'?> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
Here is my catalog.xml:
Kod: Zaznacz cały
<?xml version='1.0'?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="-//W3C//DTD XHTML 1.1//EN"
uri="D:/Program_Files/xslt/dtds/xhtml11/xhtml11.dtd"/>
<nextCatalog catalog="d:/Program_Files/xslt/dtds/oasis-docbook-4.2/catalog.xml" />
<nextCatalog catalog="d:/Program_Files/xslt/dtds/docbook-xsl-ns-1.76.1/catalog.xml" />
<nextCatalog catalog="d:/Program_Files/xslt/dtds/docbook-xsl-1.77.1/catalog.xml" />
<nextCatalog catalog="d:/Program_Files/xslt/dtds/docbook-xsl-1.77.1/catalog.xml" />
</catalog>
Kod: Zaznacz cały
@echo off
set in=D:/some/dirs/dialog.xml
REM set XML_DEBUG_CATALOG=1
set XML_CATALOG_FILES=J:/lang/xml/catalog.xml
d:\program_files\xslt\bin\xmllint --noout --nonet --valid %in% --sax
You may also use SGML catalog, using --catalogs switch and SGML_CATALOG_FILES environment variable, but I found it sufficient to use the first format.
Thanks to catalog debugging I found that on my system a default location for catalog file is d:/Program_Files/xslt/etc/catalog. So I created that etc directory, copied my catalog.xml there and removed the extension. It works! Without specifying any vars.