[xml/sgml] How to reference docbookx.dtd via file://?

Michael Smith smith@xml-doc.org
Wed, 1 Dec 2004 21:41:42 +0900


Jeff Chimene <jeffchimene@yahoo.com> writes:

> Hi Mark,
> 
> Thank-you for the detailed reply!
> 
> --- Michael Smith <smith@xml-doc.org> wrote:

[...]

> I also use the XEmacs psgml mode.

Ah. Well, you might want to think about moving to James Clark's
nxml. Debian package name is "nxml-mode". Home page is:

  http://www.thaiopensource.com/nxml-mode/

There is a link there to a good tutorial, written by John Simpson,
and links to a couple of overviews of it that are linked to there.
One is a section that I contributed to the O'Reilly "XML Hacks"
book and the other other is an item I wrote up for the xmlhack
website James first release nxml. The xmlhack item is out of date
now, but it has some color screen shots that show what you see
when it's doing real-time validation.

I think if you try it, you'll be hooked.

psgml was great in its day, but it's a relic now. At least for XML
editing. nxml is smaller, simpler, and faster. It currently lacks
a few of the convenience features that psgml provides, but James
is still actively developing and adding feature when he can.

One downside of nxml is that it currently doesn't work with
XEmacs. Only with GNU Emacs. Note from James about that -

  http://groups.yahoo.com/group/emacs-nxml-mode/message/92

[...]

> > at all. So if you don't have an internal subset, you
> > can omit the DOCTYPE completely and everything will 
> > work fine.
> 
> Agreed. However, I'd have to remove it from the
> document before the XSLT phase?

Or pipe it through sed or something to filter it out at runtime.

  xmllint xmlcatalog_man.xml | sed 's/^<!DOCTYPE[^>]*>$//' | xsltproc custom.xsl -

> > And for the case of doing validation, you can
> > validate DOCTYPE-less documents just by explicitly 
> > specifying the URI for the DTD on the command line
> to
> > your validation engine; e.g.:
> 
> Agreed. However, validating in real time is important
> to me.

Then you should definitely try nxml. It does true real-time
automatic validation in the background. If something in the part
of the document that is currently displayed is invalid, you will
know instantly.

> > And you don't necessarily need to use 
> > update-xmlcatalog to add custom catalog entries; 
> > you can use xmlcatalog directly to create
> > a custom catalog
> 
> OK, I'll use that instead. The Debian docs seem to
> deprecate xml-catalog; which is why I mentioned that
> instead of update-xmlcatalog.

Actually, I had never used update-xmlcatalog directly and I hadn't
bothered to check the doc. Looking at it now, I see it has --local
--file switches that'll let you update a local catalog. So you can
use that also. I guess my point about it just that you can create
local catalogs and use those instead of updating the system
catalogs. I personally prefer not to touch the system catalogs
directly, to prevent conflicting with or overwriting entries that
a package may add.

> Yes, it does! I do have one final question: shouldn't
> dbforms.dtd be in an xml catalog? I'm not an expert on
> this, but it seems to exist only in the SGML catalog,
> not the corresponding XML catalog.

That's a question for Mr. Mark Johnson to answer, I guess.

  --Mike