|SGML for Windows NT: Setting up a free SGML editing and publishing system on the Windows NT platform|
|Prev||Chapter 9. DocBook and HTML document type definitions||Next|
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 '( ( "HTML 2.0 Strict Level 1" "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0 Strict Level 1//EN\">") ( "HTML 2.0 Level 1" "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0 Level 1//EN\">") ( "HTML 2.0" "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">") ( "HTML 3.2" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">") ( "HTML 4" "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">") ("DocBook 3.1" "<!DOCTYPE Book PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\">") ) )
Strictly speaking, the last entry does not yet belong here, but we will need it when we install the DocBook DTD. Just keep in mind that we inserted these lines already at this point.
Create the directory structure
Having all DTDs in a separate directory tree simplifies the maintenance greatly. Therefore create a new \sgml\dtd subdirectory in a directory which has read access for all users on your system, e.g. C:\user\default. This will be the root directory of all DTDs.
Copy the files
Create a subdirectory html and copy all relevant files (html*.*, isolat1.*, and xml.*) from the OpenJade-1.3\pubtext installation directory into your new html subdirectory.
Create the catalog file
Open a new catalog file in the same directory using Emacs, e.g. by typing C-x C-f c:/users/default/sgml/dtd/html/catalog [RETURN]. Insert the following lines:
PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN" "html-1s.dtd" PUBLIC "-//IETF//DTD HTML 2.0 Level 1//EN" "html-1.dtd" PUBLIC "-//IETF//DTD HTML 2.0//EN" "html.dtd" PUBLIC "-//W3C//DTD HTML 3.2 Final//EN" "html32.dtd" PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "html4.dtd" PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML" "isolat1.ent" PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" "isolat1.ent" PUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" "htmlsym.ent" PUBLIC "-//W3C//ENTITIES Special//EN//HTML" "htmlspec.ent"
As the DTD and entity files are in the same directory as the catalog file, a path is not necessary. However, if you want to use a single catalog file for all your DTDs and put it e.g. into C:\user\default\sgml\dtd, you would have to specify the filenames as e.g. /html/html.dtd. In the following procedures I assume that you use several catalog files to simplify the descriptions.
Register the catalog file
Add the full path of your new catalog file, e.g. C:\user\default\sgml\dtd\html\catalog, to the semicolon-separated list of your environment variable SGML_CATALOG_FILES. Use the procedure as described previously.
Create your ecatalog file
Create a new file called ecatalog in the same directory as the previous catalog file, e.g. by typing C-x C-f C:/user/default/sgml/dtd/html/ecatalog [RETURN] in your Emacs. Enter the following lines into this new file:
PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN" "html-1s.ced" PUBLIC "-//IETF//DTD HTML 2.0 Level 1//EN" "html-1.ced" PUBLIC "-//IETF//DTD HTML 2.0//EN" "html.ced" PUBLIC "-//W3C//DTD HTML 3.2 Final//EN" "html32.ced" PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "html4.ced"
Register your ecatalog file
Put the following lines into your _emacs:
;; ecat support (setq sgml-ecat-files (list (expand-file-name "c:/user/default/sgml/dtd/html/ecatalog") (expand-file-name "c:/user/default/sgml/dtd/docbook31/ecatalog")))
Again, the last line is not related to the HTML DTDs, but we will need it later. Restart your Emacs to let the changes in _emacs take effect.
Parse the DTDs
Create a new file in your Emacs with the extension .html, e.g. by typing C-x C-f c:/user/myself/test.html. This should load PSGML automatically. Now use e.g. the DTD->Insert DTD->HTML Strict Level 1 menu command to insert the document type declaration into your test document. PSGML should automatically start to parse the DTD (if not, use the DTD->Parse DTD menu command or simply press C-c C-p). As PSGML finds a corresponding entry in the registered ecatalog file but no parsed DTD, it will automatically save the DTD as html-1s.ced in the \html subdirectory.
Repeat this procedure (you may reuse your test file by killing the first line) for all HTML entries of the DTD menu.
Set the SGML declaration
Locate the line
in your _emacs and adjust the path to your local system.