In the beginning, there was the Standard Generalized Markup Language (SGML). SGML evolved from the need of large corporations to better work with both paper and electronic communication, and by the early 1990s, it was both a demonstrable success and a bit of a problem. The difficulty with SGML lay in the fact that, as a language (or technically, metalanguage), it had become too flexible; the possible permutations for the ways that SGML could be described made it impractical for use in the low bandwidth, low expertise environment of the Web. Hence, the W3C chose to use SGML as the foundation for XML, resulting in the formal publication of the W3C XML Recommendation in 1998.

One of the major stumbling blocks to adoption of XML has been the lack of tools that facilitate the creation of XML-specific documents. Expecting a reporter or technical writer to open up a text editor and start writing fully compliant XML to a specific schema is, to put it mildly, unrealistic. Just as HTML really never went beyond a niche specialty until the creation of WYSIWYG, it’s only with the emergence of reasonable editing tools for XML documents that the promise of XML as a way of creating document information has become a reality. XMetal 4 is playing a major role in that process.

Document editing with XMetal 4
When you talk about an XML editor, it is important to differentiate between a data editor, an application editor (such as what’s used to write XSLT or XQuery), and a text editor. Each of these has a very different focus, and applications that have strived to be all three often end up being inadequate for any one of the operations.

XMetal started out life as an HTML editor (the well-loved HotMetal editor by SoftQuad, recently purchased by Canadian software giant Corel), and has very quickly become the sine qua non of XML document editors. It is a tool that is designed to be used by journalists, writers, and publishers within shops that specialize in producing editorial content—whether that is newspapers, magazines, Web sites, portals, or for independent syndication.

XMetal feels more like a traditional word processor in the mold of Word or Open Office than it does an XML manipulation program. It uses a custom-designed schema (the Journalist schema) to provide a set of “styles” that define the logical structure of the document—citations, annotations, section times, paragraphs, headers, and so forth. As shown in Figure A, users can insert (though not resize) images, establish external links, create tables of contents and bibliographic information, and so forth without ever dealing with the fact that the documents they are creating are, deep down, XML documents with their own intrinsic structure.

Figure A
XMetal 4 provides a number of customizable views to help edit your XML documents, including a full text, tagged text (shown here), and XML view.

XMetal features
There are a number of useful capabilities that extend this editor paradigm. XMetal can, for instance, import Microsoft Word .doc files and convert them into the default XML structure. The process isn’t perfect because Microsoft uses style sheets in a slightly different manner than is conducive to XML translation, but it’s close enough to simplify the task of managing all of those Word documents.

XMetal also includes hooks for converting the XML files created into HTML format for Web production, using one of several cascading style sheet templates to provide the requisite visual presentation. Additionally, XMetal can use the Apache FOP application to convert the files into Adobe Acrobat (PDF) format.

One of the principal reasons for the popularity of Microsoft Word as a format is the fact that you can track changes that have been made to documents, and you can add annotations inline to comment on specific aspects of an article or chapter. These features have also been incorporated into XMetal, so that you can maintain (within the XML) both annotations and changes of text and structure, and have some powerful tools for doing reviews on articles. With these capabilities, XML documents become much more “living,” an important aspect of any content management system.

The “magic” that makes much of this possible comes from the incorporation of a macro facility that currently uses either Javascript or VBScript, but that can use any language that is currently supported under the Microsoft scripting environment (for instance, you can use ActivePerl by ActiveState to have your developers write macros in Perl, if that’s the relevant language in your IT shop). Additionally, it’s possible to incorporate .NET languages such as C# if you have the .NET Framework available. These macros work against a rich document object model to lay out dialogs, child element properties, and the like. The additional Corel product XMetal 4 Developer lets programmers create additional macros (and edit or remove existing ones) in the .NET Studio development environment, using the XMetal Document Object Model or a specialized XML language. This tool also includes a forms generator for creating XML-centric form tools.

There are few aspects of XMetal that don’t impress me. Nonetheless, I have some complaints. The mechanism for associating an XML document with a schema was not at all obvious, and trying to map to an OASIS docbook format produced an unworkable mess. Because different content managers are likely to develop their own custom schemas, this struck me as being more than a little troublesome.

Similarly, a facility that would have made it possible to download schemas, DTDs, and macro resources (or even a user area that had these resources) definitely would be a valuable resource. It’s understandable that Corel, having just acquired XMetal recently, has not had much of a chance to set up a developer’s network for this, but such support could make a big difference, especially given the amount of work necessary to create alternative schema tools.

XMetal 4 is priced competitively at $495 retail for the Author package and $995 for the Developer package (which includes the Author package). Additionally, XMetal can be incorporated as an ActiveX Control (through XMetal 4 ActiveX), which can be used as an instance of XMetal Author within Internet Explorer. This makes it a useful solution for developing broad-based content management interfaces.

XML in the mainstream
XML-based content management systems have finally moved out of the shadows to become an integral part of today’s IT strategy. The ability to create XML content cleanly and efficiently, without placing the burden of abstraction or tagging on your writers, makes it easier to migrate critical portions of your company’s “corporate memory” into a form that can be easily repurposed, stored, and catalogued. XMetal 4 is a worthy editor to make this happen.