> But this, it seems to me, is what we have catalogs for. In straight
> SGML, I'd just do this:
> <!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main DTD Driver File//EN" [
> <!ENTITY % Project PUBLIC "-//Stoa//DTD Project TEI mainline//EN">
> and everyone would be happy. Nsgmls is OK with this even if it's being
> told to parse XML. But since this *isn't* proper XML syntax for public
> identifiers, Xalan correctly complains that the file is not well formed.
I am puzzled, because SGML now seems like a distant horrible memory, but
why do you have the entity in that doctype subset?
anyway, it seems to me that what you want is
<!DOCTYPE TEI.2 PUBLIC "-//TEI P4//DTD Main DTD Driver File//EN"
should be acceptable to any XML processor; you might need to use
onsgmls instead of nsgmls, of course.
Why do you want to use ngsmls, however? It is/was a great bit of
software, but there are better XML parsers these days. I would use
xmllint if in doubt, or rxp. Both of these are open source C programs
which should compile anywhere, and don't have that yucky Java
dependence. I can see where you might want Xalan in a Java servlet
context, but otherwise I cannot see much advantage to it.
xmllint also has schema support, for both W3C schemas and Relax NG,
something which nsgmls will never have (I assume). At present,
the schema support is not really useable, but Daniel Veillard
is working on it on a daily basis (watching his ChangeLog
is amusing) and I would imagine its only weeks before a release
which would work with the TEI Relax NG experimental schemas
> OK, I realize I need a system identifier next to that public
> identifier. But the whole point of the public identifier is so I can
> specify the location of the files that make up the DTD in *one* place,
> in my catalog file, rather than in the headers of every single one of
> the user's XML files. So I want to tell the parser to look at the FPI
> and *ignore* the system identifier.
thats exactly what XML parsers are *supposed* to do, surely?
does Xerces implement XML catalogs?
if so, they allw you to map a system entity like "foo.dtd" to
an absolute local path, so you can use it anywhere. xmllint
supports that, as does xsltproc.
Luckily Gregory has explained the Java way of doing all this,
so I don't have to expose my total ignorance of such things.
Sebastian Rahtz OUCS Information Manager
13 Banbury Road, Oxford OX2 6NN. Phone +44 1865 283431