Thursday 29-Jul-2010.
New Book
XRay XML Editor
Company
University
Solutions
<TAG>
Xmlu.com
Current Weather
Ski Conditions

Article from August, 1996.


Corel WordPerfect 7: Daisyware

By Kurt Conrad

Kurt Conrad is founder and president of The Sagebrush Group.

By Susan Schmaltz

Susan Schmaltz works at the US Department of Energy's Hanford site in Washington state.


Abstract

This article is a review of WordPerfect 7. Covered are features of the software and the significant improvements that have been made. Kurt and Susan include examples and real-life applications that they have used as well as discussing some drawbacks that they have encountered.


We spent quite a bit of time and made quite a few attempts to write an introduction to this article that provides a fair reflection of our feelings about this product. It was a difficult task, because our feelings are not just mixed but very polarized.

There is a very real danger in writing about this product at this time. That danger is to fixate on the problems and deficiencies and, by doing so, overlook what has been accomplished. Our first few drafts of this article did exactly that. Our list of horror stories is long and detailed, and space does not permit us to share but a few of our experiences.

Between the two of us, we have been using and supporting WordPerfect for more than 20 years. We've built applications on top of WordPerfect that most would never have thought of, much less tried. For all those years, the software has consistently delivered a price/performance ratio that exceeds that of its competitors. The price for all tiis power is usability, and the software has often been criticized for being more difficult to use than its less flexible competitors. Version 7 continues this trend, and we applaud WordPerfect for moving out ahead of virtually every other mainstream word processing software vendor in their support for SGML.

Corel WordPerfect 7 accepts arbitrary DTDs, supports real time validation, and provides context-sensitive pick lists for inserting elements. This is serious SGML software that can be picked up for a mere $89.95 in some stores (and that even includes "bonus " applications, like Quattro Pro and Presentations). We even used it to write this article (using a DTD supplied by <TAG> ). With the exception of a few problems that are described below, it worked quite well. Just remember the computer equivalent of the Chicago voting maxim: Save early, save often.

We have been waiting a very long time for WordPerfect to ship a stable commercial version of this product... And we are still waiting. The current version of this product still has quite a few bugs and holes and has a real tendency to blow up and lock up your computer. We even canceled our June course, for example, because the software was too unstable for a classroom environment. We have spent the last few months waiting for the latest bug fixes, often to find the new version is less usable than a previous one.

History and Architecture

Instead of taking a conversion-based approach to SGML support, WordPerfect started out by adding an SGML parser to their DOS-based version 5.1 formatting engine. This was Intellitag 1.0. (See <TAG> December 1992.)

WordPerfect 6.1, SGML Edition WP6.1/S was the first Windows version to support SGML. The SGML tools were designed to be sold as an "add-on, " and a "pre-release " version was made available to the general public in late 1995. WP6.1/S never made it past the pre-release stage, however.

Corel bought the company in 1996 and programming resources were focused on completing the 32-bit, Windows 95 version WP7. SGML development also shifted to WP7. Enhancements have been made to the SGML support throughout this period and those enhancements will be rolled back into the 16-bit version WP6.1 in the next few months. Very few changes have been made to the file formats between WP6.1/S and WP7 and in many cases, logic .LGC and layout specification .LSI files can be used in both versions without being rewritten.

Today, all shipping versions of WP7 include the SGML toolkit, but you have to perform a custom installation to access it. The specific set of tools is likely to vary somewhat, depending on which software bundle you purchase. By the time that you read this, for example, the shipping version of Office Pro is to include Corel Visual DTD, which is a modified and updated version of Microstar's Near and Far tool.

WP7 also adds significant enhancements to the online documentation. The help files are more context-sensitive and the extensive use of pop-up button text makes the software much easier to use. In all fairness, many of the problems that we experienced are not specific to the SGML modules but are bugs in the base product which were introduced in the port to Windows 95. Corel has announced plans to ship update CDS quarterly to registered owners and there has been some discussion of distributing SGML bug fixes more frequently via the Internet.

WordPerfect's SGML toolkit is split across three separate executables:

  • DTD to LGC validates incoming DTDs and compiles them to a binary format ( .LGC file).

  • The Layout Designer allows you to build style sheets by attaching WordPerfectdtd formatting codes to SGML markup.

  • Extensions to WordPerfect's authoring environment allow you to perform a variety of tasks, such as opening and closing files, applying DTDs, inserting markup, and validating documents.

The DTD to LGC Utility

The DTD to LGC Utility

The DTD to LGC utility ( DTD2LGC, see Figure 1 The DTD to LGC Utility) converts ASCIIDTD files into a binary form (a logic, or .LGC, file) that WordPerfect uses in the Layout Designer and authoring environment. To prepare a DTD for use with WordPerfect, specify the name and location of the DTD and the name and location of the LGC file that is to be written. WordPerfect uses its default declaration file DEFAULT.DEC if none is specified.

Map files are used to translate PUBLIC, SYSTEM, and entity identifiers into local paths and filenames. For those of you familiar with the SGML Open catalog specification, WordPerfect's .MAP files won't hold any real surprises. The only real difference is that WordPerfect requires an additional entity type identifier as part of each entity mapping entry. For public identifiers, this field should match the public text class keyword. While somewhat redundant, this convention improves readability of the MAP files, especially for system identifiers.

WordPerfect also uses a proprietary "WPCHARS" entity type identifier to do some nice things with character mappings. WordPerfect ships with two sets of character mapping files. The first set matches normal conventions. The second set takes advantage of WordPerfect's large set of internal characters to display such references in fully-rendered form, not just as a string of text ( e.g. , &aacute;), and convert special characters into their associated entity references.

Finally, DTD2LGC lets you identify one or more directories that contain the entities listed in the entity mapping file. If the filename in the MAP file contains a full path specification, DTD3LGC will only look for the file at that location. If an entry in the MAP file references a filename without a path, the listed directories are searched, as are the current directory and map files directory.

The errors/status field displays the files used and any error messages. This report can be written out to a separate .LOG file that uses either the base name of the LGC file or a fixed filename.

A number of SGML features are not supported. These include:

  • The DESCSET section does not support quoted character descriptions.

  • Only SCOPE DOCUMENT is supported. Changes to the reference concrete syntax that are accepted by DTD2LGC are stored in the .LGC file and used for all validations.

  • Only the name start characters LCMNSTRT and UCNMSTRT defined in the reference concrete syntax are supported.

  • NAMECASE substitution is supported for GENERAL names and tokens and not for ENTITY names. These settings cannot be overridden.

  • GENERAL delimiters are limited to those in the reference concrete syntax.

  • SHORTFEF is not supported.

  • Reserved NAMES cannot be reassigned.

  • OMITTAG is the only supported markup minimization feature. DATATAG, RANK, and SHORTTAG are not supported.

  • None of the LINK type features are supported.

  • CONCUR is not supported.

  • SUBDOC is not supported in the SGML declaration.

  • SUBDOC, DOCUMENT, and NOTATION cannot be used as referenced entity types in a DTD. SUBDOC entities can exist as user-declared file references in the editing environment, however.

Generally, we have found compiling DTDs to be a straightforward process. Not only are the error messages fairly clear, but double-clicking on the error brings up a more detailed explanation that usually includes suggestions on how to correct it. This is particularly useful. On a few occasions, however, the error messages didn't make much sense and it is possible to find DTDs with which the software doesn't work very well (the full CALS table DTD, for example).

The Layout Designer

The Layout Designer's Main Screen

The Layout Designer (see Figure 2 The DTD to LGC Utility) allows you to attach WordPerfect formatting codes to SGML markup. WordPerfect has a quite powerful set of text formatting commands, and most of these are available within the Layout Designer.

These specifications are saved in a layout .LSI file for use with the editor. Multiple layout files can be created for the same DTD and selected within the editor. Layout specifications can also be saved as a text file. WordPerfect has also announced that it will provide an SGML-based import and export capability, using a proprietary DTD.

The main screen of the Layout Designer is used to create new element layouts and interact with previously-defined element layouts. The Select New Element field creates a new element layout, adds that element's name to the Element List, and activates the Element Layout screen. The same element may appear multiple times in the Element List and apply different layouts based on parentage, attribute values, or condition (first or normal). These qualifying rules are summarized on the right side of the window.

If multiple layouts have been defined for the same element without any qualifying rules, the first one in the list will be used by WordPerfect. This is not as predictable as it sounds, however, as the order can change (apparently randomly) in the LSI file.

The Layout Designer's main screen also shows whether a macro has been attached to the element, indicates the type of the element, and provides access to the Counters window. Element Type is used to associate one of a number of WordPerfect features with an element and open the appropriate window when an associated element is inserted. This works nicely for inserting tables in an SGML document. Counters are defined outside of the elements that are used to increment and/or display them and multiple-level counters are supported.

By default, WordPerfect removes whitespace (tabs and spaces) where data is not allowed and converts returns to spaces where data is allowed. While this conversion can be deactivated within the editor, the Layout Designer also provides a list of all elements and each can be flagged for protection through a simple check box.

The Layout Designer's Element Layout Window

The Element Layout window (see Figure 3 The DTD to LGC Utility) provides access to most of WordPerfect's formatting functions. Formatting codes can be executed at three locations, after the start tag, before the end tag (before Revert), and after the end tag (after Revert). We also wish that there were a way to execute formatting instructions before the start tag. Inserting white space ahead of the start tag would make many structures easier to read, and when working with tables, we have ended up adding a wrapper element around the table to add the necessary white space.

WordPerfect automatically restores (Reverts) most layout functions to their original states at the end of the element. The two separate end-tag formatting fields allow you to choose whether to perform processing before or after the revert takes place. Revert can also be used with individual formatting commands in the start tag field. The Insert menu contains a Revert option that brings up a list of the formatting commands which can be restored to their previous state by using Revert.

The Rules button on the Element Layout window brings up the Element Rules window. This is where an Element Layout can be restricted based on parentage, attribute values, or whether it is the first of a series. It would be nice if the list of conditions were extended to include "not first, " "last, " and "not last. "

Overall, the Layout Designer provides quite a bit of flexibility and it is possible to work around most restrictions (although Kurt's blew up and he had to use the one that came with version 6.1 to prepare this article). It is even possible to retrieve information from one LSI file and insert it into another one. Susan recently set up an application that used a set of DTDs for different chapters of a large, multipart document. She created an LSI that only contained layouts for the base elements of a DTD and then retrieved it into each of the chapter-specific Layout Specifications.

We have bumped into a few limitations with the Layout Designer. One is that Rules to control processing cannot be based on CDATA attributes. All of the releases of WP7 that we have seen also have a limitation on the number of elements that can be used in a Layout Specification. Likewise, there are a number of known bugs in the revision queue that cause the software to crash and sometimes lock up the computer.

We would like to see the Layout Designer make use of styles or some other mechanisms for allowing groups of formatting commands to be reused across individual Element Layouts and revised more easily.

WordPerfect's SGML Editing Environment

WordPerfect 7 in SGML Mode

When WordPerfect is in a normal editing mode, it's hard to tell that it's an SGML tool (see Figure 4 The DTD to LGC Utility). Unless the SGML toolbar is active, the only evidence is an option on the Tools menu. In SGML mode, however, the screen takes on a much different appearance. Red is used consistently to identify SGML icons and tags (a legacy of the Novell days?), and a separate SGML menu item is displayed.

WP7 has matured over many generations and is an incredibly sophisticated program, with base editing features that surpass those found in most SGML editors. Virtually all of these features (including a number of advanced automation tools) are available in SGML mode.

WP7 uses a hybrid file format that stores SGML codes in a binary format and allows you to intermix WordPerfect and SGML codes in the same document. All in all, it works quite well, but it would be nice if there were a way to manually enter, modify, and delete individual SGML codes to support certain types of restructuring that can't be easily done using the provided interface.

Working with an SGML document usually starts with defining or selecting a Document Type. Document Types are used only within the editing environment to assign a user-defined name to a logic file .LGC, an optional alias file .LNM, and optional layout files .LSI. Alias files can be used to substitute the element names in the DTD (and thus in the logic file) with other names while in the editing environment ( e.g. , "paragraph " instead of "p " ).

Once an SGML document is active, new elements can be inserted by "picking " them off of the Elements window, or by using a feature called Logic Chaining. Logic Chaining automatically inserts required elements and simplifies the process of inserting sibling elements. Inserting an additional paragraph element, for example, usually only involves hitting the Enter key twice. With the Elements window open, the first Enter moves the cursor outside of the current paragraph and activates the Elements window, highlighting the last element used ( "paragraph " in this case). The second Enter inserts the highlighted paragraph element in the document.

Instead of simply pressing Enter a second time, you can also type the first few characters of a different element to highlight it, instead. If you are reasonably familiar with the DTD, you can use Logic Chaining to insert most elements without ever touching the mouse or even looking at the Elements window. Most of this article was written with the Elements window tucked off the bottom of the screen, leaving only the title bar visible so that color changes could be monitored to verify which window was active.

The Elements window can be set to display all elements or only valid elements; the display of inclusions can be activated or suppressed; and the Content Model field can be turned on and off. Another set of options allows you to select the prompting for attribute values (always, never, or only when required).

The Edit Attributes window provides a list of the attributes which have been defined for the current element. By highlighting each attribute on the list, the window displays its type (the declared attribute value) and value (either default or user-defined).

If you have used a supported table type in your DTD, WordPerfect's automatic table tagging feature is also available. The following table DTD fragments are included with and supported by WP7: aap_tbl.dtd, cals_tbl.dtd, wptable.dtd, wp60tbl.dtd, wp60min.dtd. The included HTMLDTD also contains a table fragment that can be used in other DTDs.

With the proper DTD support, creating a table is a three step process.

  • Create a table with the number of rows and columns that you want by using the Create option on the Tables menu or by using the Tables button on the Power Bar.

  • Format your table by entering data, joining and splitting cells, and activating and deactivating lines.

  • With your cursor positioned in the table, click the Tag Tables button on the button bar. If you make any changes to the table, you should re-tag it to make sure that all of the elements are inserted correctly.

WP7 contains some interesting validation options. The Validation window contains check boxes for toggling specific types of error checking. The Validation subsystem also provides lists of logic errors and IDs and IDREFs. The Logic Error List can even be left open on the desktop to provide real-time feedback during editing. The ID/IDREF List shows you which IDs have been referenced, which have not, and if any have been referenced, but not assigned. We have had some problems with the validation function. The worst one involves the Equation Editor and causes WP7 to freeze up and Windows to display an "illegal operation " error.

Entity management remains a little rough. While working on this article, for example, we tried to include graphics. We used the File References window to assign an entity name to one of the .GIF files, but when we tried to reference the entity, it was not listed and could not be entered as an attribute value. The entity declaration was included in the declaration subset, however, when the SGML file was written.

Last December, Kurt was using WP6.1/S to work on a book project and discovered that the editor was stripping entity declarations from the declaration subset of each chapter file. This problem has not been fixed in WP7. The Text References window only seems to allow you to insert references that have been declared in the DTD and not allow you to create general CDATA and SDATA entities within the scope of the instance.

WP7 also allows the user to select a base element different from the one specified in the DTD, insert ignore codes, and insert and edit comments. There seems to be a problem with incoming comments, however. As was mentioned earlier, WP7 uses a hybrid file format. The editor inserts WordPerfect comment codes in the document which are converted to SGML comments when the file is saved as an SGML file. Sometimes, however, when an SGML file with comments is brought into WP7, the comments are not displayed. They show up in reveal codes and can be edited, but they are not rendered in the editing window.

A number of options exist for the display of SGML codes. They can be displayed as text (the default is red, 10 point Times New Roman), displayed as markers (little red diamonds), or they can be hidden. In Reveal Codes, SGML codes can be expanded to show either the formatting commands which are being used or the attribute values which have been defined.

A number of different conversion approaches can be used. Needless to say, WordPerfect's macro language is quite powerful and can be used to develop filters to convert documents based on their control codes or styles if sufficient data is formatted consistently enough to justify the investment. For smaller jobs, Susan likes to open two editing windows, the first with the original document and the second with the target SGML document. By tiling the two windows it is easy to cut and paste between them, creating new elements, as necessary.

Kurt prefers to use the DOS-compatible keyboard, which allows him to block text using the function keys. He puts the original text at the bottom of the SGML document (after the root element's end tag) and uses a combination of cursor and delete keystrokes to move text into the SGML structure. We both claim that our approach is superior and may schedule a race during the August class.

The saving process is straightforward, although sometimes cumbersome. SGML documents can be saved as a native WordPerfect file (the software defaults to the WP6.1 file format). This preserves any WordPerfect codes which may have been used in the document. To save as an SGML file, it is usually necessary to do a Save As and change the file type to SGML. It would be nicer if saving SGML files were a more direct process. For example, WP7 has a Save Format window that allows you to choose between SGML and WP6.1 file formats without all of the overhead of the Save As command, but is only used in a few situations and doesn't adjust the filename extension to match the chosen format.

When saving an SGML file, the Save As SGML window allows you to determine whether to check for errors, convert Soft Returns to CR/LF codes, include the SGML declaration, and in some instances, include the DTD. The resulting SGML files, while valid, wrap strangely and are hard to read. It would be nice to have more control over how whitespace is added to an SGML instance.

Summary

Corel WordPerfect 7 is the first mainstream word processor to include an SGML editor at no additional charge. It has a rich, but immature feature set and promises, at some point in the (hopefully not-too-distant-) future, to be a very useful and important tool. In the meantime, it can be used to support sophisticated applications if care is made to work around its limitations and instabilities.

And with that we pick up our daisy: We love it. We hate it. We love it. We hate it. We ... <end/>

Format for Printing



HomeContactusCopyright
All original material on this site is copyright © 1994-2010 by Architag International Corporation, All rights reserved. No part of this information may be reproduced in any form without express permission from
Architag International Corporation.