Home > Products > upCast > Support > TechNote 1
HowTo 1 Supplying additional DTDs |
This document describes how to add additional local DTDs to upCast for validation and processing purposes.
To find local copies of DTDs, upCast makes use of so-called catalog files. Catalog files are in their simplest form translation tables mapping a public identifier to a file kept (in most cases) locally on your computer. The mapping can be both for public and system identifiers.
Each time the XML parser need to access a DTD or external entity, it asks an entity resolver component for it. This component can be configured using catalog files, so you can redirect e.g. a request for the system id http://someserver.com/mydoctype.dtd
to file:///DTDs/mydoctype.dtd
and thus avoid a HTTP connection and retrieval operation from the net. This both speeds up processing, reduces network traffic and lets you even work when offline.
upCast can be configured to use such a catalog file. To tell upCast which one to use, call Extras > Choose XML Catalog File... and choose the catalog file to use from then on. This catalog is remembered across sessions and it is used until a different catalog is set.
The first time you run upCast on your system, you will be asked whether you want the application to set up a default catalog. It is highly recommended to do this or use Extras > Setup Default XML Catalog to have it done some time later. This not only installs the upCast DTD locally, but also automatically lays out the directory structure we recommend for later adding your own DTDs.
To add your own local DTD to the pool of DTDs upCast should know about, follow these steps:
If you haven't already, install the default catalog by choosing Extras > Setup Default XML Catalog. This will place the current upCast DTD on your hard drive under {DTDs Folder}.
Quit upCast.
Download the infinity-loop DTD pack. This is a .zip file including a few standard DTDs commonly used with upCast. Extract the archive and follow its included installation instructions.
Put the constituent files of the new DTD (preferably enclosed by a folder) into the {DTDs Folder}.
In the {DTDs Folder}, you'll find a file named catalog
. This catalog is used as an include file to reference the installed DTDs' own catalog files. Edit this file to also have an appropriate entry for resolving your DTD's public or system identifier, or to include its own catalog file if it comes with one. Examples:
PUBLIC "-//company//DTD MyDTD 1.0//EN" "file:MyDTDFolder/mydtd.dtd"
SYSTEM "http://www.company.com/dtd/mydtd.dtd" "file:MyDTDFolder/mydtd.dtd"
CATALOG "file:MyDTDFolder/catalog"
Start upCast and pick the just edited catalog file as the one to use using Extras > Choose XML Catalog File... .
Author: Christian Roth
Last revised: 2004-03-29 11:55
© 2003-2007 infinity-loop GmbH Send mail to Webmaster Anbieterkennzeichnung §6 TDG