Print

Print


I am a postgraduate student at Canterbury, UK, and I would like to use
the major mode "psgml" for emacs to encode a dictionary using the TEI
DTD for dictionaries.  However, there is a problem which I am unable to
solve; so I would appreciate your help.  I am sorry, if this is a
problem already discussed at the list.  It follows a description of the
problem.
 
Being not an emacs expert, I somehow managed to install psgml and it
works fine as long as no DTD is involved ...  However, when parsing the
TEI2.DTD, the psgml built-in parser gives the following error message in
the echo area:
 
        Expecting a name; at: - O  (%n.tei
 
 
And the SGML log gives me the line number where the error occurred, that
is line 51 in the TEI2.DTD:
 
  48    <!-- A TEI document is a text preceded by a TEI header.         -->
  49    <!ENTITY % TEI.2 'INCLUDE' >
  50    <![ %TEI.2; [
>>51    <!ELEMENT %n.TEI.2;     - O  (%n.teiHeader;, %n.text;)          >
  52    <!ATTLIST %n.TEI.2;             %a.global;
  53              TEIform               CDATA            'TEI.2'        >
  54    ]]>
 
 
I invoke (or better: I try to invoke) the Dictionary DTD as described in
the Guidelines (section 3.3):
 
        <!DOCTYPE TEI.2 SYSTEM 'tei2.dtd' [
                <!ENTITY % TEI.dictionaries 'INCLUDE'>
        ]>
 
The settings in the .emacs file follow at the end.
 
I hope that this is all the information necessary to solve the problem.
I would be really happy if somebody could help here, since my whole
project depends on it.  Thanks in advance,
 
Jakob Fix.
----------
University of Kent at Canterbury,  [log in to unmask]
 
 
---- psgml settings in the .emacs file ----------------------------
---- probably not all are necessary, but I am not sure which ------
 
 
(setq load-path (cons (expand-file-name "~/lib/emacs") load-path))
 
;; SGML mode
 
  PSGML settings
; For more info see <http://www.lysator.liu.se/projects/about_psgml.html>
;
 
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t )
 
(setq sgml-always-quote-attributes t)      ; expected by many clients
(setq sgml-auto-insert-required-elements t)
(setq sgml-indent-data t)
(setq sgml-indent-step 2)
(setq sgml-suppress-warning t)
(setq sgml-auto-activate-dtd t)            ; preload dtd
(setq sgml-omittag nil)
(setq sgml-shorttag nil)
 
(setq sgml-system-path
        '("." "~/psgml" "~/lib/sgml"))
(setq sgml-public-map
        '("~/lib/sgml/%o/%c/%d"))
 
; menus for creating new documents
(setq sgml-custom-dtd '
(
  ("TEI DTD Dict." "<!DOCTYPE TEI.2 SYSTEM 'tei2.dtd' [
        <!ENTITY % TEI.dictionaries 'INCLUDE'>
   ]>"
   sgml-omittag t sgml-shorttag t
   sgml-balanced-tag-edit t
   sgml-auto-insert-required-elements t)
 
  ("TEI Lite" "<!DOCTYPE TEI.LITE SYSTEM 'teilite.dtd' >"
   sgml-omittag t sgml-shorttag t
   sgml-balanced-tag-edit t
   sgml-auto-insert-required-elements t)
)
)
 
;; (setq 'sgml-validate-command "")
 
(defun html-mode ()
  (interactive)
  (sgml-mode)
  (make-local-variable 'sgml-declaration)
  (make-local-variable 'sgml-default-doctype-name)
  (setq sgml-declaration
                "~/lib/sgml/teisgml.dec"
        sgml-default-doctype-name    "sgml"
        sgml-always-quote-attributes t
        sgml-indent-step                2
        sgml-indent-data                t
        sgml-minimize-attributes        nil
        sgml-omittag                    t
        sgml-shortag                    t       ))
 
; End of PSGML settings
 
(setq auto-mode-alist
        (append '(
                ("\\.sgml$" . sgml-mode)
                ("\\.html$" . html-mode)
                ("\\.htm$"  . html-mode)
                )
              auto-mode-alist
        )
)