While trying to validate the output of cl-blog-generator I needed a local DTD for XHTML. The textproc/xmlcatmgr package in Darwin Ports creates a catalog at /opt/local/etc/xml/catalog, but it does not include XHTML. A flattened XHTML DTD can be found in the w3 validator library and installed the DTD's under /opt/local/share/xml/, but I couldn't find a catalog file for it. It turns out it is pretty simple to write the catalog file; the Wikipedia XML Catalog entry has an example that contains what is needed. Save the example next to the XHTML DTD's as catalog.xml and adjust the paths, then add a "nextCatalog" entry in /opt/local/etc/xml/catalog pointing at the catalog.xml file.

Now I can use (setf cxml:*catalog* (cxml:make-catalog '("/opt/local/etc/xml/catalog"))) and CXML will use the local DTD specified in the catalog.


Comments


Thanks for taking the time to contribute.

All comments are moderated and I reserve the right to remove comments for any reason, including abusiveness, illegality, and spam links.

Comments are plain text, with blank lines seperating paragraphs. Anything that looks like a URI will become a link. Any HTML will be escaped and appear as you type it in.

(optional, will not be published)
(used to link your comment back to you)

Create a Catalog for XHTML on OS X
Written: 11-3-2009
Tags: