Skip to main content

Using Emacs for XML documents

Install add-ons to the powerful Emacs text editor to build a platform-independent (and free) environment for working with XML

Return to the article


Listing 7. _emacs - enabling OpenSP for validation

; override default validate command to utilize OpenSP's onsgmls executable
(setq sgml-validate-command "onsgmls -s %s %s")

; override default xml-mode validate command to utilize OpenSP's onsgmls
; executable by using a mode-hook, since there appears to be no other means 
; to accomplish it.
(defun my-psgml-xml-hook ()
  (setq sgml-validate-command "onsgmls -s %s %s")
  (setq sgml-declaration "d:\OpenSP\pubtext\xml.dcl")
)
(add-hook 'xml-mode-hook 'my-psgml-xml-hook)