[XML-SIG] DTD location

Lars Marius Garshol larsga@garshol.priv.no
21 Aug 2000 16:33:42 +0200


* Alexandre Fayolle
| 
| I'm using a SAX parser that I get from
| xml.sax.saxexts.XMLValParserFactory.make_parser(), and I would like
| to know if there is a way to tell the parser where it can find the
| DTD, so that I don't have to set an absolute path in the document.

The best way to do that is to use a public identifier in your
document, like so:

  <!DOCTYPE doc PUBLIC "pubid" "sysid">

Then you can use the SAX EntityResolver based on catalog files
provided by xmlproc (which is always the parser you get back from that
method, since it is the only alternative) to map the public identifier
to the location you want.

Alternatively you can write your own EntityResolver and make it do the
mapping for you without using a catalog file at all.

See

  <URL: http://www.garshol.priv.no/download/software/xmlproc/catalog-doco.html >

for information on catalog files.

--Lars M.