nXML is Fantastic
For a long time, my SGML/XML editor has been Lennart Staflin's venerable PSGML mode for Emacs.
That changed last week. I'm switching to James Clark's nXML mode for Emacs. It provides comparable editing functionality to PSGML but is easier to configure. Its realtime feedback is very helpful.
Forty-five days ago, I wrote the following in a private email:
For editing DTD based XML (human language text with semantic markups) my need is very simple:
- I want to be able to edit my text without too much interruption.
- I want a keyboard shortcut to insert an element, edit attributes, close an element, and auto-indent the text.
- I want an intellisense system that give me a list of allowed elements and a mechanism to auto-complete when I insert an element.
- I want required attributes to be automatically inserted and an easy way for me to enter their value.
- I want an intellisense system that let me know all the attribute names, types, possible values, default values, etc. when I edit attributes. I also want easy navigation among all the attributes.
I don't want anything else. In particular, I don't want a tree view or a generically styled view. I want an honest text view of my XML. I don't want to use the mouse.
nXML fulfills these requirements quite nicely. And it has that clean and nice feel as I edit my document.
One thing did change with nXML. It supports Relax NG instead of DTD as the schema language. However Relax NG Compact Syntax schema for XHTML as well as DocBook, XSLT are included. There are tools that convert DTDs to RNC schema as well as infer RNC schema from an instance document. So I won't miss DTD a bit.