Mark J. Stang wrote:
This was posted on the old dbXML list...
Diego Zamboni wrote:
But when I try to add one of my real documents, I get the following
error (the document is printed as part of the error):
% dbxml ad -c /db -f
/home/zamboni/ESP/sensors/XML/components/CVE-2000-0003.xml -n bla
Reading...
DEBUG> Error Converting Buffer '<?xml version="1.0" standalone="no"?>
<!DOCTYPE ESP-Component SYSTEM "ESP-Component.dtd">
The reason why it's failing is because ESP-Component.dtd is referenced
as a relative path. As dbXML is probably running in a separate
directory from your actual files, when the Document gets into the
server, it's unable to resolve the DTD name. One way to address this
would be to change the reference to a globally available URI (via HTTP
or a file URI accessible via NFS).
dbXML itself will canonicalize the document and strip the DTD reference
from it when it finally gets into the system, but it needs to be able
to resolve the DTD first in order to parse the Document.
Another way to solve this problem, one that is certainly more
elegant and foolproof, is to identify your DTD by name rather
than location, and use a catalog resolver mechanism.
fragile:
<!DOCTYPE book SYSTEM "docbook.dtd">
portable:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook.dtd">
Norm Walsh has published the Java jar file for such a beast, and I
can say with certainty that it works quite well with Xindice. It
essentially plugs in to your XML parser and resolves entity names
to their locations. It accepts the old SGML Open TR9401 catalog file
format, or a newer XML catalog too (which *could* be generated from
one's application -- hint). You will have to learn how to set up a
catalog, but that's pretty simple.
Info at:
XML Entity and URI Resolvers
http://www.sun.com/xml/developers/resolver/article/
Read in particular "What's Wrong with System Identifiers?"
BTW, it's free of course.
Murray
......................................................................
Murray Altheim <mailto:m.altheim @ open.ac.uk>
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK
In the evening
The rice leaves in the garden
Rustle in the autumn wind
That blows through my reed hut. -- Minamoto no Tsunenobu