February 28, 2005

Open source XML editors examined

Author: Ryan Paul

The eXtensible Markup Language (XML) provides a flexible and
efficient way to store, transmit, and express data. Many applications
have adopted it as their sole data format, and the availability of
comprehensive XML development libraries makes it easy to add support for
XML to new and existing applications. The open source community has
produced an impressive lineup of XML editing utilities. In this article
we'll take a look at some of the most useful.

Despite the numerous benefits of XML, users and developers that work
with it realize that XML's versatility is a mixed blessing. How does one
design an effective editor for a data format that can be used to express
virtually any kind of structured content? A visual editing idiom that is
appropriate for developing a user interface with XUL content may
not be appropriate for writing an essay with DocBook
content. In many cases it becomes necessary to construct a specialized
editing environment that provides a unique interface and produces valid
XML code, such as Glade or OpenOffice.org.

If one were to build a generic XML editor that could support a
multitude of vastly disparate content types, how would it work? The
structure of a given XML content type is usually specified in a Document Type Definition (DTD)
or a Schema. An application
can use this data to introduce specializations and interface
refinements. Many XML editors employ document meta-data to provide
context-sensitive assistance and automation mechanisms.

KXml Editor is a
lightweight XML editor and viewer that interfaces exceptionally well
with other KDE applications. You can configure Konqueror to use the KXml
Editor KPart as an XML view interface component. With its extensive
assortment of excellent keyboard shortcuts, KXml Editor facilitates
rapid development of data-oriented XML content. Input of element
character data requires the user to employ a textbox dialog window that
decreases the fluidity and efficiency of the editing experience. KXml
Editor allows the user to utilize XPath nomenclature to select a
single specific node, but it does not completely support the XPath query
syntax, and queries that target multiple nodes are presently ignored.
KXml Editor provides no support for content processing or validation,
and it cannot open XML documents that contain syntax errors. KXml Editor
is usable and efficient, but its limitations decrease its value as an
editing tool. It is my XML viewer of choice, and it is useful for rapid
production of simple XML documents, but it is less efficient than a
conventional editor for DocBook authoring.

Bluefish is a powerful
Web development environment that supports a number of markup and
programming languages. Despite its extensive feature set, it doesn't
provide much support for XML yet. Bluefish has a built-in project
manager and an extensible build system that works well for Java and C
projects. The intrepid user will easily be able to configure Bluefish to
support external XML validation and processing utilities. Bluefish has
an impressive function reference system that greatly expedites
development of Python and PHP. Unfortunately, it does not provide
support for XSL. Bluefish is
a great tool for diverse development projects that encompass multiple
technologies, but its not the best solution for typical XML authoring

Quanta is an extremely
powerful and extensible Web development environment that has excellent
support for XML editing, and provides users with several ways to extend
its abilities. Quanta has a nice project manager and a great interface.
Quanta's editor supports folding, syntax highlighting, context-sensitive
tag completion, and automatic tag closure. Quanta has a built-in XML
validation utility, and a really cool XSL debugger that supports
breakpoints and stepping. It has a decent template system that automates
creation of a wide variety of document types (including DocBook) and it
can create new custom templates that you can save for global use or
associate with a particular project.

You can use Kommander to write powerful graphical script utilities that extend the functionality of Quanta. Quanta's versatile action system lets you associate Kommander scripts and XML tags with keyboard shortcuts, menu items, and toolbar buttons. You can create more sophisticated extensions as KParts and integrate them with Quanta through its plug-in interface. Quanta comes with plug-ins for CVS management, multi-file search and replace, image map editing, link analysis, and XSL debugging. It is even possible to integrate KXml Editor into Quanta as an additional document view. Quanta has a tag attribute editor, and a tag tree interface that lets users efficiently navigate large documents. Quanta's elegant split WYSIWYG mode makes Web development a pleasure, and its highly configurable editor component and action system allow users to effectively utilize both the keyboard and the mouse.

Screem is an effective Web
development environment that is simple and powerful. Its interface lacks
the refinement of Quanta or Bluefish, but it is moderately innovative,
and provides some unique advantages. Screem supports context-sensitive
tag completion, brace matching, real-time validation, and a unique,
intelligent tag closure system. I was particularly impressed with the
real-time validation mechanism, which highlights any content that
invalidates the document.

Screem is not as customizable as Quanta or Bluefish, but it has a
text insertion macro feature, and a system that enables users to add
external commands to the menu. It has an integrated symbol viewer and a
function reference interface, neither of which impressed me. The symbol
viewer doesn't seem to work with C or Python, and the reference system
implementation is poor. In addition to the traditional text view,
Screem has a tree view that displays document structure, and an
attribute input interface that provides a complete list of valid
attributes associated with the currently selected tag.

As a Vim user, I tend to dislike
the limited potential for customization that plagues modern development
environments. I shudder at the prospect of using an editor that doesn't
allow me to dynamically add new features at run time. Vim customization
is really more of an art than a science. Experienced Vim users like to
do things their own way, with whatever scripting language they feel most
comfortable with.

Tobias Reif has produced an excellent guide to XML editing with
. It is a must-read for any Vim user interested in XML
development. In his guide, Reif shows how users can leverage Ruby
scripts and third-party command-line utilities like Jing and XMLStarlet to construct a
complete, versatile XML authoring environment.

users may be interested in nXML mode, which
provides Emacs with an assortment of nifty XML authoring features, like
context-sensitive tag completion, intelligent tag closure, and real-time
validation. It also provides several useful keyboard shortcuts that
simplify moving around XML documents. nXML mode employs Relax-NG (RNG) schemas rather than
DTDs. RNG is a powerful and flexible schema language based on TREX and RELAX. The limited availability
of existing RNG schemas diminishes the usefulness of nXML in some
contexts, but for DocBook editing, nXML is a good choice. Emacs users
may also be interested in XSLT-process
, which adds XSLT processing and debugging to Emacs. The
XSLT-process-mode debugger supports break points and stepping, and
displays XSLT stack frames and variables in the speed bar.

For unique insight into the future of XML editing, take a look at Conglomerate, an innovative XML
editor that features a creative interface particularly suitable for
DocBook authoring. Conglomerate uses nested boxes to represent the
document structure, and between-line annotations to indicate the
presence of inline tags. This unconventional and intuitive presentation
manages to remain unobtrusive, and conveys a lot of information about
the content of the document. Conglomerate uses DTDs to provide element
insertion context menus. Users can customize Conglomerate's view
interface with specialized display specs and external plug-ins. Yet
despite the quality of its interface, Conglomerate still needs a lot of
work. The rendering engine is far too slow, and the application lacks


All of these programs lack XPath support. Users should be able to
utilize XPath for filtering and programmatic manipulation of document
content. Many of the programs support a multitude of other technologies
at the expense of better XML support. The tools designed exclusively for
XML either have mediocre interfaces or lack performance. Despite these
deficiencies, some of these applications are superior to expensive
proprietary alternatives such as Softquad's XMetal and Wattle's XMLWriter.