Emacs is a self-documenting, customizable, extensible real-time display editor that is used in UNIX. More information about Emacs and customization can be found here. This document describes how to customize Emacs with a major mode for VoiceXML. It also provides limited VoiceXML validation capabilities.
To extend Emacs to support VoiceXML editing, you'll need the following:
- UNIX operating system (root access required)
- PSGML 1.2+
- VoiceXML 2.0 DTD.
- dictionary-mode.el file
- Catalog file
- xml.dcl file
- .emacs addition
Follow these steps to install major mode for VoiceXML:
- Download, make and install the latest (v1.2+) version of psgml from: http://www.lysator.liu.se/projects/about_psgml.html. You can find Installation instructions here: http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#SEC2
- Insert the contents of the .emacs file addition at the end of your .emacs file. If the .emacs file does not exist in your home directory, you will have to create one.
- Copy the following files to the directory /usr/local/lib/sgml:
Follow these steps to verify that installation of VoiceXML major mode was successful:
- Launch Emacs editor, and load a VoiceXML document.
- If the major mode has been installed correctly, VoiceXML elements in the document will be syntax-colored. In addition, several mode-specific commands will be available. For example, type "C-c /" to terminate the current tag. Type "Ctrl-right click" to view a context menu with commands relevant to the current cursor location.
To add validation support using nsgml, follow these steps:
- Download the SP source code from: http://www.jclark.com/sp/howtoget.htm
- Edit the Makefile:
- Add -DSP_HAVE_SOCKET, under XDEFINES (see http://www.jclark.com/sp/build.htm).
- Edit the value of the prefix variable. The prefix variables defines where NSGMLS will be installed.
The default is
- Run "make". If make is successful, run "make install".
Test nsgml by executing the following command, replacing "example.vxml" with the path to a VoiceXML document.
nsgmls -wxml -s example.vxml
Alternatively, you can run nsgml from within Emacs by typing "C-c C-v".
If you put the public DOCTYPE identifier in a VoiceXML document, nsgml must be able to fetch it. nsgml does not support authentication, so the DTD must not be hosted in a password protected location.
<!DOCTYPE vxml PUBLIC "-//Tellme Networks// DTD VXML//EN" "http://studio.tellme.com/vxml2/dtd/vxml-20-tm-pub.dtd">
If you have a local copy of the VoiceXML 2.0 DTD, you can specify it using the following DOCTYPE identifier:
<!DOCTYPE vxml PUBLIC "-//Tellme Networks// DTD VXML//EN" "/usr/local/lib/sgml/vxml-20-tm-pub.dtd">
Update the local path to the DTD accordingly.
The validator prints an error message if there is no DOCTYPE declaration in a document, but it recovers by looking it up in the CATALOG.
There are some issues related to how nsgmls and psgml searches for the DTD when it is specified both by a PUBLIC identifier and a SYSTEM identifier as in the above example. psgml requires a SYSTEM identifier; nsgmls does not.