Previous Table of Contents Next


To create an INI file for the new authoring template, copy the INI file for the supplied SGML authoring template to a new name. Modify it by adding a section for each template style, specifying hierarchical relationships among the styles, setting default styles, and configuring the Attribute dialog boxes. This is easier than it sounds, and it can be time-consuming. You can also add macros in Word Basic or C—the C macros must be converted to Word Basic. When you are done, you have a new SGML authoring template customized to your needs.

Conversion to and from SGML. Converting from Word to SGML is easy, provided that you have a DTD, a DCL file, and an association file created in SGML Author for Word. You must also have a document that conforms to your DTD. Conversion errors are reported in the SGMLTMP.ERR file.

There are a few caveats, however. Tables must follow the CALS model, and not all the attributes of all the elements of that model are supported during the conversion. Equations must follow the ISO equation tag set for proper conversion. As long as your documents are not heavily laden with complex tables and equations, you are in good shape.

Once you save the Word file, the SGML file appears in the window in the SGML Authoring view. Parsing errors are saved in a feedback file with a FBK extension (see fig. 26.13).


Fig. 26.13  The feedback file summarizes the parsing errors encountered when the document is saved as an SGML instance.

Once you solve these problems, you have a valid SGML file. To view it, open it as text only.

Converting an SGML file to Word is more challenging, depending on the SGML features that are in it. SGML Author for Word does not fully support many features. The ISO equation set and the CALS table model are supported. To venture beyond them is to invite trouble.

You must have in place the DCL file, the MAP file, the Word DOT file, and the DTD. The converter program must recognize all the descriptors and be able to associate all the SGML tags with them. If it does not recognize something, it tries to continue parsing and converting. When the converter encounters unrecognized tags with content, it either creates a new paragraph or appends the tagged characters to the previous paragraph. The converter applies the Normal style as the default.

Round trip conversions—that is, conversions to SGML and back to Word—offer a few anomalies. They can change the document. The converter adds private fields that contain default attribute values to the document so that information is not lost when the document is converted back to SGML. For example:

    <EMPH VAL=“i”>Italic text</EMPH>

gets converted to the following in Word:

    {PRIVATE SGML GI=“Emph” Val=“i”}Italic text

Another anomaly is that the converter loses multiple styles associated with one element when it is translated back into Word. For example, list items often include a final item with white space that separates it from the next legal style. Because the other list styles normally do not have this separating space, there must be two list styles for each list—the regular list style and the last list style. For example:

    Here’s a first list item in Word. Normal spacing.
    Here’s a second list item in Word. Normal spacing.
    Here’s a last list item in Word, with extra space after it to set it
    off from the next style.

The last list item adds white space to the end of the style before the next paragraph begins. The reason is because in Word it is a style different from the previous two list items. In Word, you can apply different, although similar, styles to the first two list items and the last list item. The anomaly is that when the document is converted to SGML, all the list items are tagged (such as with the tag <LITEM>). Later when you convert back to Word, the converter becomes confused when it finds two styles that apply to the <LITEM> element—unless you declare a different element for each style.

The converter knows only one element—one Word style—so it chooses the last style that you used between the two list styles. The way around this is to make sure that you declare one element for each style in Word.

Another anomaly is the bookmark feature in Word documents. The converter program has difficulty maintaining a two-way cross reference on a round trip conversion.

All in all, document conversion using SGML Author for Word is efficient and pain-free. When problems occur, they generally involve associating descriptors with Word styles.

Document Parsing and Validation. You cannot entirely parse as you go in SGML Author for Word. The parsing and validation takes place during the conversion process, and you cannot customize which document elements you will parse. For example, you cannot parse only ID and IDREF and entity declarations, as you can with WordPerfect SGML Edition. The SGML Author feedback file and the SGMLTMP.ERR file help resolve parsing errors that occur during conversion.

Highlights. Since its introduction over a year ago, SGML Author for Word has been one of the leading SGML authoring tools in its price range. It will probably be upgraded to remain competitive with the latest releases from Microstar and WordPerfect.

For creating SGML structured documents that transform easily into SGML, you might want to keep SGML Author for Word on your machine. It is a trusted, reliable, no-frills authoring tool. If you must work with several templates and keep multiple authors focused on a disciplined document structure, check out this product. It is designed especially for the system administrator who guides authors in creating valid SGML documents.

Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
Web: http://www.microsoft.com/Products/

Other SGML Tools

In addition to authoring programs, other tools that support SGML-based document systems are available. They include tools for viewing SGML documents electronically and for maintaining an SGML document system. The rest of this chapter looks at two of these packages: Panorama Pro and Near & Far. Panorama Pro is a new package for browsing SGML documents electronically. Near & Far is a tool for designing and documenting DTDs.


Previous Table of Contents Next