Previous Table of Contents Next


Chapter 27
Tools for the Mac: Authoring, Viewing, and Utilities

This chapter examines the SGML document preparation process using an Apple Macintosh computer. Although the Mac environment is ideal for text editing and writing, it’s not as well supplied with specialized SGML tools as Windows and UNIX are. Don’t despair, however. There are SGML document preparation tools for the Mac, and many of the same public domain and freeware tools that run on UNIX and DOS also run on the Mac.

In this chapter, you learn about:

  Mac-specific authoring and conversion tools and strategies
  SGML delivery tools for viewing and printing from SGML
  Public domain and network resources for SGML on the Mac

This chapter also includes examples of how to cope with common SGML tasks on the Mac, including:

  Document conversion from an RTF file
  Document conversion from plain text
  Document conversion from HTML to a more complex DTD

Planning an SGML Project on the Mac

When you set up an SGML project, you need to carefully plan the work environment, tools, and your goals. The basic process of any SGML project is the same:

1.  Select, create, or customize a DTD.
2.  Enter and mark up or convert the document.
3.  Create the final product.

Not all these phases are essential—SGML might be your final product. However, you might need to process your SGML document in order to print, display, or index it, or you might need to convert it from SGML to HTML.

A little extra planning helps ensure a smooth work process and enables you to use your time sensibly. Much of the SGML software for the Mac is public domain code, which is freely available over the networks. Carefully selecting your tools in advance is especially important, given the smaller selection of tools for the Mac.

One way to deal with the limited software choices for the Mac is to extend the range of software by building a mixed-platform environment from the beginning. A UNIX workstation that the editorial staff shares can be very useful. It not only makes a good central file space, but it also provides the most flexible scripting environment if the production process involves complex file conversion steps. A workstation is the ideal environment for inexpensive batch-style processing because the public domain tools for the Mac do not support scripting. Good ways to integrate a workstation and Macs for SGML projects are:

  Use the workstation for initial and final document conversion. Use the Mac for editing and formatting final output.
  Use Macs for creating documents, and edit with a specialized SGML editor. Use the workstation for batch conversion and formatting.
  Use the workstation for capturing or creating documents and for post-processing the SGML. Use the Mac for formatting and layout.

The real strengths of the Mac in a mixed environment are an easier user interface, easier system and file management, and good mouse-based editing. A UNIX workstation provides superior batch processing facilities, easier programming for knocking out quick conversion or update scripts, and the greatest number of public domain tools—as long as you have the technical support to compile them. The drawback is the obvious need for technical support. Likewise, the powerful free software available for UNIX, such as the PSGML mode for emacs, tends to have cryptic interfaces.

Authoring and Conversion Tools for the Mac

Document conversion is a constant problem in text processing. SGML eases the task by providing a common language that can be easily processed and exchanged. Nonetheless, you often need to convert legacy documents or create non-SGML output formats for input to other tools. In these cases, the best approach depends on whether you are converting to or from SGML.

Converting to SGML is a task that depends greatly on the structure and regularity of the input files. You can often accomplish 90 percent of a simple conversion by using the global change facilities of a word-processor or ASCII editor. Complicated or irregular formats might be better converted by using a programming tool to match patterns and to reorder and format the output. Conversion from SGML is usually accomplished with an SGML parser coupled with a programming language. It is also done with the global changes or general-purpose scripting tools.

SoftQuad’s Author/Editor is a popular commercial SGML authoring environment on the Mac. It’s an editor for SGML that uses the structure of a particular DTD to prompt and control how documents are entered. A separate utility compiles the DTD into an internal form that controls how the SGML document is created, and ensures that the result matches the DTD. During editing, Author/Editor stores the document in an internal form for fast access. You must export the document to get a conforming ASCII SGML file.

Stilo is another structured editor for SGML. Its basic features are similar to those of Author/Editor, but DTD compilation is integrated into the basic editor. Stilo features an innovative graphical display of the structure of the DTD.

Another approach is simply to use an ASCII editor targeted to programmers. They are generally well suited to demanding editing tasks and support regular expressions, global changes, and keyboard and programmed macros for repetitive work. When you use an SGML-unaware editor, you need a separate validator for the resulting files to ensure that they actually follow the rules of SGML and your DTD.

If your DTD is not very complex, you might be able to take a low-tech approach and use popular HTML tools. You can customize many of them with new tags to accommodate the rapid changes in the HTML DTD. If the DTD is simple enough that the tagger needs little help other than a separate validation pass at the end, this is a plausible, low-budget solution.


Previous Table of Contents Next