[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: FYI: Emacs/PSGML doesn't support SYSTEM entries in SGML catalog files
(Ignore this message if you don't use PSGML mode for Emacs. I actually don't anymore, except for testing. I use nXML instead. But I noticed the following when trying to test support for an SGML catalog file for the next Slides release.) For the record: Emacs/PSGML only supports catalog resolution for public IDs in doctype declarations, not system IDs. It treats all system IDs as local paths and can't do catalog resolution for a system ID that is a URI -- like, for example, http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd Already knew that? Good for you. But I didn't, until today. And I reckon that some people using Emacs/PSGML probably don't know it either. Which is why I'm posting this message... Anyway, for anybody who cares, here are the specifics - If: - you have a catalog file (SGML catalog file, not XML catalog file) that includes a SYSTEM entry that maps a system identifier to a local path, like this: SYSTEM "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" "/usr/share/xml/docbook/schema/dtd/4.1.2/docbookx.dtd" - and you add the path to that catalog file to the value of the SGML_CATALOG_FILES environment variable - and you have a file that has a DOCTYPE declaration that lacks a public identifier but that has a valid system identifier that matches the catalog entry you added; like this: <!DOCTYPE article SYSTEM "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> then: - if you attempt to validate that file using nsgmls/sgmls, nsgmls/sgmls will read the catalog file as expected and correctly resolve the system identifier and validate using /usr/share/xml/docbook/schema/dtd/4.1.2/docbookx.dtd - BUT if you attempt to edit that same file in Emacs/PSGML, and do a C-c C-p (sgml-parse-prolog), you will get an error message saying: External entity article not found The reason is that there is no logic in PSGML for parsing SYSTEM entries from SGML catalogs. If you want to check for yourself, take a look at the code for the sgml-parse-catalog-buffer function in psgml-parse.el. Or do M-x describe-variable sgml-catalog-assoc after you've taken a catalog that contains system id entries and added it to your SGML_CATALOG_FILES variable. What you'll see is that the value contains data about all the public ID entries from the catalog, but not the system ID entries. So if you are editing a file in Emacs/PSGML, you either need to make sure the doctype contains a valid public ID that has a catalog entry on you system, or you need to use a local path in the values of the system ID in the doctype. --Mike -- Michael Smith http://logopoeia.com/ http://www.oreillynet.com/pub/au/890
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]