Re: [xml] Telling libxml how to find the DTD

On Sat, Nov 16, 2002 at 07:08:15PM +0100, Murray Cumming wrote:
How can I tell the libxml parser where to find an installed DTD? In
Xerces-C++ I had to provide an entity resolver for this.

  Hum, usually the XML catalog is the Right Way to do this,
rooted in /etc/xml/catalog it registers the resources locally
installed and is looked automatically by the library when a resource
need to be find.
  Now at the API level it is also possible to install a resolver
the signature is 
  xmlParserInputPtr xmlNoNetExternalEntityLoader(const char *URL,
                                                 const char *ID,
                                                xmlParserCtxtPtr ctxt);
 taken from the exemple of the resolver installed by xsltproc(.c)
when the nonet option is requested.
  Still the best is to make sure the document instances use the
canonical URLs and the public ID for the resources and have them
cleanly installed in the catalogs (like for DocBook on Linux distributions


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]