Re: [xml-dbms] reference to DTDs of map and action in v2
- 1) I did a bit of research on the Apache Web site, since I've wondered
about this, too. According to:
the problem is that, when you pass an InputSource built on a Stream to
Xerces (which is what Transfer does), Xerces does not know what the base
URI of the InputSource is. Therefore, it cannot resolve relative URIs
correctly and defaults to using the current directory. The solution to
this is to call setSystemId on the InputSource before passing it to
I tried the following code and it works:
// Get a FileReader over the XML file and construct an
// InputSource over that file.
File f = new File(filename);
FileReader fr = new FileReader(f);
InputSource is = new InputSource(fr);
// Get the base URL of the file and set it as the system ID
// of the InputSource.
// This code is technically incorrect on Windows systems.
// The problem is that path contains ":" and "\" characters,
// which need to be replaced with "|" and "/", respectively.
// However, Xerces does interpret the URL correctly.
String path = f.getAbsolutePath();
String systemID = "file://localhost/" + path;
// Parse the document. (Or pass the InputSource to the map
// compiler, etc.)
If you are calling DOMToDBMS directly, you can just modify your code
that passes InputSources to MapCompiler, ActionCompiler, and/or
FilterCompiler. If you are using Transfer, you will need to modify the
code in the createMap, createActions, and createFilterSet methods.
2) If this code doesn't work for some reason, then the DTDs (without
comments) are available at:
However, you don't really want to use them. The problem is that your
users will hit the Web every time they compile a map, filter, or action
file. VERY slow.
> In the map and action-files I have to specify a DTD.
> Could you place the 2.0 alpha 3-DTDs at
> http://www.rpbourret.com/xmldbms/xmldbms20alpha3.dtd and
> Working with local relative path does not work for me, because (on Sun with jdk
> 1.3 and xerxesImpl.jar)
> <!DOCTYPE XMLToDBMS SYSTEM "xmldbms2.dtd">
> is translated to ~/xmldbms2.dtd (which is not user-independend) and not relative
> from the place of the map-file (in the same directory as the map-file).
> Or is the some other possibility to reference the DTD?