XMElegance - An Extensible Editor For XML

Richard Moore, rich@kde.org

Introduction

XMElegance is an XML editor designed to make maximum use of the facilities offered by KDE and Qt. It is sensitive to the document type it is editing, and makes use of KParts to allow for maximum flexibility and extensibility. It is currently very pre-alpha, so I'm not releasing anything yet but it already has the beginning of a decent framework, and loads different configurations for RDF, HTML, QML (Qt's internal markup) and DocBook files. In addition, it embeds the KJS engine from Konqueror to provide an internal script engine (DCOP scipting will be added soon too), to which I've added a bridge giving it access to the properties of QObjects and the ability to use the new QWidgetFactory dialog loader that has been added to Qt in the version 3.0 betas.

DocBook Mode

This is barely started, but by embedding the Kate editor part, it can already syntax highlight the HTML. The tree view on the left shows a (somewhat broken) tree of the document structure. The tree is another KPart, as is pretty much everything else. The image on the right, shows a preview of the docbook document created using the help ioslave, and displayed in KHTML.

HTML Mode

The image below shows an editable rich-text view of a simple HTML document. The editing view is a KPart wrapper around the new QTextEdit component. The bottom of window shows another KPart, this one providing a console for entering javascript commands. The scripts can access the message window, create dialogs with QWidgetFactory and in future will be more powerful still.

RDF Mode

This image shows the rich-text editor again, this time displaying an RDF file. The document can be edited in a WYSIWIG view because this document type configuration defines a custom stylesheet, to define how the XML should be rendered.