Set Free


Syntext recently released a GPL version of its powerful Serna XML editor. We took a tour of the new free Serna.

By Marcel Hilzinger

lawren, 123RF

The XML (eXtensible Markup Language) format has been established as a standard for many tasks: Ebooks, content management systems, and even OpenOffice.org documents are all based on variations of the XML format. If you want to use XML, you need a good editor. Syntext Serna [1] is an enterprise-grade commercial WYSIWYG XML editor with support for DITA, Docbook, XHTML, and many other XML document types. In June 2009, Syntext released a free version of Serna under the GNU General Public License (GPL).

The GPL version doesn't include some of the features available in the enterprise edition, such as special modules for collaborative editing and plugins for Microsoft Word drag and drop ActiveX support. (The Serna homepage lists the differences between the free and enterprise versions in a feature comparison [2].) However, the free edition does offer an array of options for the purposes of basic XML editing.

In this article, I take a look at version 4.2 of the Serna Free XML Editor, which first appeared in August 2009. The RPM and TGZ packages are found at the Syntext website [3]. The source code for version 4.2 is available from a Subversion repository. The following command transfers the goodies to your computer:

svn checkout svn://oss.syntext.com/oss/serna-free/trunk

However, keep in mind that you'll need several external libraries for a successful build.

Changing the Language

Serna defaults to English as the standard language, but you can change the language for the whole document or for individual elements. To change the language, right-click an element and select Edit Attributes. In the dialog that appears, click the icons with the @ and the + characters and select the lang attribute from the drop-down list. Then enter the country code for the language (such as de for German).

Adding a language attribute for the main tag (which would be the book tag in the Docbook example) changes the language for all elements; if you select the attribute for one chapter, the changes only apply to the chapter heading and content, which means you can add an English abstract to a document in another language.

Templates

Syntext Serna installs in /usr/local/serna-version_number, where you will also find stylesheets, DTD files, and other components. After you complete the installation, launch Serna with the serna-4.2 command. A selection dialog lets you choose between popular XML publication formats, including DITA, Docbook, and other options. If this is your first experience with Serna, it is a good idea to visit the Serna Users's FAQ.

The user interface (Figure 1) is divided into four sections. The XML document itself appears on the right side of the window, and the menu and toolbars are at the top. Serna displays a tree view of the document structure on the left. The status line and Serna error output are located at the bottom of the window. To toggle between the various view modes and enable the information window, use the four icons in the bottom left corner. If you have multiple documents open, click one of the tabs to display a document in the foreground.

To open a new document, select Document | New Document.

Figure 1: The content map on the left side of the window shows the structure and matching tags. At the bottom left, you can see which documents you are editing .

Working with Serna

Serna adheres strictly to the XML schema and does not allow arbitrary tags. Pressing Ctrl+Enter opens a new tag. Serna displays a dialog box with the available elements.

In the case of XML elements that require a selection (e.g., for author information), you will see a green field labeled Choose. Then you can click to select the sub-elements. Selecting Edit | Validation disables strict validation; alternatively, you can switch the mode from Strict to On. In On mode, Serna will insert the element but will display a warning if the element infringes on strict validation.

If you are editing a simple Docbook file (Figure 2), the selection box might slow you down with its myriad possible elements, but you will appreciate the true value of the WYSIWYG editor when you insert an image or table. Just click the icon in the toolbar or select Edit | Custom Content, and with only a couple of clicks, you can insert an image or a complex table.

Figure 2: A simple Docbook document.

If you choose the Docbook V4.5 category for a new document and then select Book as your template, for example, the editor will create a new document with Title, Table of Contents, and Draft area for "book" metainfo on the start page. To access the Title tag, use the cursor, or click on Title to insert the new title.

Next, press Ctrl+Enter to open the element selection box and choose subtitle for a subtitle or chapter for the first chapter, for example. The list of available elements changes depending on where the mouse cursor is. For chapter, you need to insert at least one of the chapterinfo or title tags before beginning the paragraph text.

Conclusion

Serna's weak point is its text editor. Although you should never really need to resort to text-based editing when you are working in a WYSIWYG interface with well-formed and valid XML files, I was forced to press F6 in our lab on various occasions to enable the text editor. Apart from simple syntax highlighting, Serna offers very little in the way of text features. For example, there are no line numbers and no support for search and replace with regular expressions.

On the layout side, Syntext Serna relies completely on XSL/XSLT and corresponding format objects (XSL-FO). If you have used CSS files in the past to tweak the appearance of your XML documents, you will have to do without this option in Serna. Also, in our lab the options for transforming to PDF or HTML format were not fully functional because the pathnames for the document type definitions were not always correct.

Syntext Serna mainly targets professional users who work with the Docbook or DITA document type definitions. The free version has a large collection of tools and templates for this task. If valid XML code is not your major concern and you simply need to edit an XML file, you might be better off with a standard editor and syntax highlighting.

INFO
[1] Syntext Serna homepage: http://www.syntext.com
[2] Comparing the Serna enterprise and GPL versions: http://www.syntext.com/products/serna-feature-matrix/
[3] Download Serna: http://www.syntext.com/downloads/serna-free/