Using Jing With A Catalog
Jing is a utility to validate XML files using a Relax NG schema. Among the other options available, it's the one I prefer because it's so light and quiet: if there are no errors, it writes no output. This is how everything should work. No error == silence. It's also fast and exhaustive: if there are errors, it tries to identify each error instead of "giving up" after a few errors, like many other tools do.
When trying to validate XML files, it's often the case that these files have a DTD declaration; but if the DTD cannot be found the XML parser generates an error.
The problem of finding DTDs is, of course, solved with catalogs. But Jing does not seem to have an option to use catalogs, according to its homepage as linked to above.
So until now I was stuck with using Jing for files that didn't have a DTD declaration (or to somehow make the DTD findable without a catalog, which is a task in itself). I found this quite strange, though, so I started digging to check that I wasn't missing something obvious.
As it turns out, you can use Jing with catalogs since December 2008:
- use the most recent build of jing, from Google Code
- make sure resolver.jar is sitting next to jing.jar (download it from the catalog link above)
- use the -C option (capital C) followed by the name of the catalog (in OASIS format) when invoking jing