A Tour of XMetaL

July 14, 1999

Liora Alschuler

The basic interface will be familiar to anyone who has used SoftQuad's HoTMetaL editor. The working document can be displayed in plain text, tags on, normal, or browser preview modes. Save, undo, find/replace, spell check (just the content, not the markup, thank you), and cut/paste are just what you would expect. The right-hand panel is a context-sensitive list of all elements valid at the current insertion point. On the Formatting Toolbar, where Word has a drop-down box for styles, there is a second, context-sensitive list of element names, customized to contain commonly used elements. Plain text view uses the same controls as IE5, which include a default styling of tag names and a collapsible/expandable, indented display of document contents. Missing from the interface is an automatically generated tree or structure view of the document or the doctype. SoftQuad left this off to make the document more WYSIWYG word processor-like, but here it seems to have mimicked a liability rather than a strength. click to load illustration

The XMetaL Interface in Tags-on mode.

Easy customization

The interface and behavior designed for the Journalist DTD distributed with Release 1.0 illustrate how XMetaL can accommodate a specific working environment. There are four types of customizations: appearance using a CSS style sheet editor; behavior using the Customization editor; behavior and DOM access using macros and scripts; and COM (ActiveX) controls for integration with repositories, databases and publishing systems.

The Customization editor assigns context-sensitive behavior to key stroke combinations. In the belief that pressing Enter should always do something sensible, SoftQuad has done some pretty fancy guesswork on where you want to go from "here." With the insertion point at the end of a paragraph, pressing Enter once enters a new paragraph tag pair; pressing it again inserts a Section 1 with its required content; pressing it a third time demotes the Section 1 to a Section 2. The Customization editor also makes it easy to designate what should happen on insertion of a new element. You can add required sub-elements, run a script and change the default for "next tag."

One of the disconcerting aspects of many SGML and XML editors is that if you try to type text when the insertion point is not in a place where text is legal, nothing happens. The XMetaL Customization editor lets you designate an element type to be wrapped around illegal text and inserted at the next point where such an element is allowed.

The address dialog invoked from the toolbar of the Journalist's DTD was created using XMetaL macros and a short Visual Basic script. A separate macro launches the dialog, which is a COM object. Using the XMetaL API, the dialog box content is inserted into the correct place in the document when the user clicks Submit. When you have written your macros and scripts, it is easy to select an icon for the macro and drag it onto a toolbar. The macro tool, however, does not record CSS styles. The software encourages use of templates so that a new document can start out with boilerplate text and all required markup. Areas where text needs to be entered are indicated with prompts.

click to load illustration

Address dialog box created with macros and a VB script.

click to load illustration

Dialog box created with macros and a VB script.

SoftQuad has demonstrated that if you know your document type well, and you know the way information is entered, you can build an interface that will speed and ease the work of writing.

Cascading Style Sheets support

XMetaL uses a subset of the W3C's CSS2 to format text and do layout for screen presentation. Its designers have added non-CSS, Word-like running headers and footers to support hard-copy printing. Inserting a style sheet link inserts an XML processing instruction pointing to the CSS file so that a browser, or any external application, will associate the document with the proper style sheet. The resulting display, of course, is contingent on the support for the standard within the browser which, at present, is a choice between grim and grimmer. Microsoft's Internet Explorer 5 supports fonts, bold, italic and colors, but not much else, including lists. Support is better in Mozilla builds, but, with the exception of Citec's Doczilla, these are not commercially available. The primary purpose of applying styles here, however, is to give feedback to the writer while writing. Since most material written in XMetaL will be published out of a database, it is less important what the browser will do directly with CSS.

XMetaL has a full CSS editor and a Quick Styles dialog that assigns alignment, block/inline, bold, italic and font size to any of the elements in the doctype. The full CSS editor controls background, text spacing, text borders, and list types. It also controls the context of the applied style, so that <Title>, as the immediate child of <Article>, can have a different look than <Title> as the child of <Subsection>.

click to load illustration

Quick Style Sheet Editor.

If your DTD uses CALS or HTML 4 table markup, you get WYSIWYG word processor-like control over tables. If you want to change the semantic markup of the table cells, you are basically out of luck in this release.

For the most part, the CSS editor gives sufficient, if rudimentary, control over size, type and position to the extent necessary to guide the writing process. However, SoftQuad hasn't implemented all of CSS2, and if you approach this as a layout or text manipulation tool for Web pages, you will be disappointed.

Taking the good with the bad. One welcome feature of the interface is direct control over color and typeface of narrative and markup for the plain text view and control over the tag icons in "Tags On" view. One current limitation is that you can associate one and only one style sheet with a document and the style sheet must carry the same name as the document type definition. One style sheet per document is a far cry from the ease with which style sheets can be swapped in Word or WordPerfect, and an odd limitation for a product that takes such great pains to separate form and content.

Because XMetaL is not a stand-alone product, most of the CSS-related limitations are not going to interfere with the basic task of writing. There is one aspect of the implementation, however, that seems inconsistent with the general philosophy of the product. While the CSS editor is an integral part of the XML writing environment, SoftQuad has segregated it in a curious way. All the toolbar icons on the default interface, and the ones on the customized Journalist environment, affect XML markup directly, putting in XML elements, attributes and entities. The CSS controls are in dialog boxes. So, in the journalists' environment distributed with release 1.0, a toolbar icon for "emphasis" inserts an <Emphasis> tag pair, and the style sheet has assigned italics to the tag. The same visual effect can be achieved by using the CSS editor to assign italics to any selected element.

Highlighting text and making it bold, italic, or underlined is a basic feature of word processing. It seems anomalous to place the XML markup-level control on the main interface and the CSS style-level control in a dialog box. The writer does need to know if she is editing the document or the style sheet, but why couldn't certain basic CSS controls be on the main toolbar? The differential treatment of document markup and style sheet rules is one aspect of XMetaL that doesn't seem well thought out. If the intent was to make the product as Word-like as possible, SoftQuad has missed a chance to integrate application of styles into the interface. While it is true that users need to know the difference between changing document markup and changing the style sheet, this is one instance where SoftQuad could have made some deference to the conventions of established retail products.