Chapter 1What is a resolver?

An XML Resolver is an tool for mapping URIs to local resources. The name comes from the fact that there are APIs to support this mapping in most XML parsers and the underlying catalog format grew out of an existing markup standard. In principle, it can be used in any environment where it would be useful to remap URIs.

The web encourages us to name resources with URIs. This is generally “a good thing,” but there are circumstances under which it’s inconvenient. A canonical example is when you don’t have reliable internet connectivity. Sometimes it’s useful in applications to return a locally cached resource instead of the resource actually requested. For example, it’s a significant feature of the web that you can dereference the URI

  |http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd

and find out that it’s the DTD for XHTML. It is not, however, desireable that everyone should always dereference that URI to get the XHTML DTD. It hasn’t changed in more than a decade and there’s no reason to believe it will ever change again.

The same is true of resources located in repositories like Maven and NuGet, where institutional policies dictate that once a resource is published, it can never be updated in place.