Install the DocBook XML DTD

Note: The procedure to install the XML version of the DTD is pretty similar to the installation of the SGML version. If you set up your system for both SGML and XML processing, chances are that pieces of the _emacs code described below already exist. Instead of just pasting the following chunks at the end of _emacs, you should modify your existing code by merging the missing pieces.

  1. Unzip the files

    Extract the contents of the DocBook XML DTD archive into a new directory in your XML tree, e.g. c:\user\default\xml\dtd\docbook412. Using the version number in the subdirectory name simplifies the installation of several versions in parallel (you might need to install or keep older versions for reasons of compatibility with older, existing documents).

  2. Register docbook.cat

    The DTD archive contains a catalog file named docbook.cat which must be added to the SGML_CATALOG_FILES environment variable. Use the procedure as described previously. Append the full path (including the filename) of the catalog file, e.g. c:\user\default\xml\dtd\docbook412\docbook.cat, to the semicolon-separated list.

    Locate the line

     –– OVERRIDE YES ––
    
    in the catalog file and remove the leading and trailing dashes to uncomment this entry. This will allow PSGML to work smoothly with the XML DTD.

  3. Create ecatalog

    Use Emacs to create the file ecatalog in the DocBook XML directory, e.g. c:\user\default\xml\dtd\docbook412. Insert the following line:

         PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "docbookx.ced"
       
    

    and save the file.

  4. Register your ecatalog file

    Put the following lines into your _emacs:

         
    ;; ecat support
    (setq sgml-ecat-files
      (list
        (expand-file-name "c:/user/default/xml/dtd/docbook412/ecatalog")
    ))
          
       
    
  5. Access the DTDs via the menu

    PSGML allows to insert the document type declaration via menu commands. To this end, all DTDs that you want to use this way have to be added to a variable in your _emacs. Insert the following lines into your configuration file:

         
    ;; PSGML menus for creating new documents
    (setq sgml-custom-dtd
    '(
      ( "DocBook XML 4.1.2"
       "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">")
      )
    )