EntityResolver API


The EntityResolver API lets you convert a public ID (URN) into a system ID (URL). Your application may need to do that, for example, to convert something like href="urn:/someName" into "http://someURL".

The EntityResolver interface defines a single method:

  resolveEntity String(publicId, String systemId)

This method returns an InputSource object, which can be used to access the entity's contents. Converting an URL into an InputSource is easy enough. But the URL that is passed as the system ID will be the location of the original document which is, as likely as not, somewhere out on the Web. To access a local copy, if there is one, maintain a catalog somewhere on the system that maps names (public IDs) into local URLs.


 

Home