title: How to use saxon built-in catalog feature
body: <p>I downloaded SaxonHE9-4-0-6J and want to process XHTML on CLI. However Saxon tries to load DTD from W3C and it takes too much time for every simple command.</p>
  
  <p>I have xml catalog, which I use successfully with xmllint by set env variable pointing to catalog file, but I have no idea how to make Saxon use it. Google reveals whole history of changes (thus confusion) in regards of using catalogs with Saxon, and none made me happy.  </p>
  
  <p>I downloaded resolver.jar and set it in my CLASSPATH, but I can't make Saxon use it.
  After various combinations, I followed <a href="http://www.saxonica.com/documentation/sourcedocs/xml-catalogs.xml" rel="nofollow">http://www.saxonica.com/documentation/sourcedocs/xml-catalogs.xml</a> by using just catalog variable, like:</p>
  
  <p><code>-catalog:path-to-my-catalog</code></p>
  
  <p>(tried both URI and regular paths), and without setting <code>-r</code>, <code>-x</code>, <code>-y</code> switches, but Saxon doesn't see it. I get this error:</p>
  
  <blockquote>
    <p>Query processing failed: Failed to load Apache catalog resolver
    library</p>
  </blockquote>
  
  <p>resolver.jar is set in my classpath and I can use it from command line:</p>
  
  <pre><code>C:\temp&gt;java org.apache.xml.resolver.apps.resolver
  Usage: resolver [options] keyword
  
  Where:
  
  -c catalogfile  Loads a particular catalog file.
  -n name         Sets the name.
  -p publicId     Sets the public identifier.
  -s systemId     Sets the system identifier.
  -a              Makes the system URI absolute before resolution
  -u uri          Sets the URI.
  -d integer      Set the debug level.
  keyword         Identifies the type of resolution to perform:
                  doctype, document, entity, notation, public, system,
                  or uri.
  </code></pre>
  
  <p>OTOH, Saxon archive itself already includes XHTML and various other DTDs, so there must be simple way out from this frustration.</p>
  
  <p>How to use Saxon on command-line and instruct it to use local DTDs?</p>