| | -
| | Normal View provides an editing interface much like a word processor. The writer can put the cursor just about anywhere, start typing and something reasonable will happen. |
-
| | The Style Element List and the Enter Key |
| | In a word processor you finish one block (paragraph-like) style element and start a new one by pressing the Enter key. The style that follows the current style can be customized. To change from one style to another, the writer selects from a drop-down list on the toolbar. |
| | XMetaL behaves in a very similar fashion. What is called a "style" in a word processor corresponds to a block XML element. In XMetaL, when a user presses the Enter key, a new block element is started. The customizer has control over which element that is, and a judicious choice can help guide the user as to what to do next. |
| | If the user wants to change from the element supplied by default, he can choose an alternative from a drop-down list (the Style Element list) on the toolbar. The choices presented to the user at the point are only those which are allowed by the DTD. They can be further filtered by the customizer so a smaller, potentially less intimidating, set of choices will be presented. |
| | The Enter key has one other important role in XMetaL that builds on another characteristic of a word processor. In a word processor, if you want to finish a list, you press Enter twice. The first Enter creates an empty list item, the second Enter changes that list item into a paragraph. XMetaL extends this concept to solve the general problem: how does the user move "up" the tree of nested XML elements? |
| | The answer is, "Press Enter". For example, if the DTD enables a structure like this: |
| | Section
SubSection1 SubSection2 Paragraph |
| | and the user is in theParagraph
, by successively pressing Enter, the user will move up the tree, going toSubSection2
,SubSection1
, and finallySection
. |
| | These then are the two basic mechanisms for a user to work with elements at different levels: the Style Element list is used to select a child element, the Enter key is used to move up to a parent element. |
-
CSS, Cascading Style Sheets  Cascading Style Sheets |
XMetaL supports the use of CSS to give the customizer control over the display of the document. (The word "style" in the CSS sense should not be confused with "style" as used in the discussion of word processors in the previous section.) Properly chosen styles can be very helpful to indicate the current context to the writer. |
| | Remember that styles are there for the presentation of the document during an editing session. They do not necessarily need to correspond to any particular kind of output format. |
| | Styles have an influence over editing behavior too, in one important respect: block and in-line element types. When XMetaL encounters a DTD for the first time, it makes a guess at which elements should be block and which should be in-line. These choices can be changed at any time by the customizer. |
| | Block elements participate in more editing behaviors than do in-line elements. Some examples: only block elements will appear in the Style Element list; only block elements can have a "followed by" element; the notion of using Enter to move up the tree only applies to block elements. |
| | CSS can also be used to generate text which can provide valuable feedback to the user. |
-
| | Templates are documents that provide a starting point for the user. They can be used to give an outline of the structure desired in a document and hence provide valuable guidance on how to create it. |
| | Replaceable text can be used to provide more detailed guidance. Sections of the template can be designated as read-only to prevent the user from changing them. |
-
| | XMetaL has a lot of sophisticated editing behavior that is predefined for elements that are like lists and images. To tap into this, it is just a matter of identifying which elements are lists and which are images. |
| | You can also tell XMetaL to treat certain elements as paragraphs. This is an indication to XMetaL that this element is a good place for the user to type text. You can even indicate the order of importance of paragraph-like elements. This information is used when XMetaL has to decide what element to put in next to create an editable area. |
-
| | Several editing events are exposed so that you can handle various user actions. One of the most important of these is the event that an element is being inserted. You have the opportunity then to insert a "mini-template" of markup or run a script. This is a powerful way to insert default content, prompt the user for information or set up special attributes (like IDs). |
| | Other events result in specially named macros being called.On_Document_Open_Complete
is one example. This gives you the opportunity to do any special setup required for that document. |
| | One other important event is that the user has changed the editing context. This results in theOn_Document_UI
macro being called. This is the time to disable any toolbar buttons, menu items and macros that are not currently valid. This is a very important thing to do, because it prevents the user from being frustrated by taking apparently valid actions that can only result in error messages. |
-
| | Replaceable Text refers to sections of text that appear with a gray background in the document. When the user moves their selection there, the entire section of text is highlighted and is replaced by the user's text as soon as the first key is pressed. The text that is displayed in the replaceable text area is up to the customizer, providing another way to give the user guidance. |
-
| | Any element in a document can be marked read-only through scripting. This prevents the user from changing parts of a document that are intended to be fixed. |
-
| | All the toolbars in XMetaL are customizable. New toolbars can be created and any macro can be associated with a toolbar button. |
| | Just as importantly, any toolbar button can be removed, so if there is some functionality you don't want your users exposed to, you can prevent it from being displayed. |
-
| | Menus have customization properties similar to toolbars. They can be created or removed and any macro can be associated with a menu item. |
-
| | Some important customizations are provided to prevent users from getting at certain options. A good example of this is plain text view. In that view, ongoing validation is disabled and it is possible for an unsophisticated user to inadvertently create invalid content. If you are concerned about such a situation arising, it is possible to disable plain text view altogether. |
-
| | XMetaL exposes over 300 COM interfaces, all available through scripting. XMetaL is a Windows Scripting Host, so you have your choice of languages. Out of the box, JavaScript and VBScript are supported, but script engines for Perl, Python, Tcl and others are also available. |
-
| | You can create dialogs to provide more sophisticated and specialized user interfaces for your DTD. This is especially useful for form-like portions of the DTD. Dialogs are created in any external programming language that can target COM, such as C++, Visual Basic, and Java. |
-
| | Any COM DLL that you create can be invoked from XMetaL. This can be useful for interfacing to databases, etc. |
-
| | XMetaL provides the ability to invoke help topics from a script. And since you can determine (through scripting) the current context of the user, it is possible to provide precisely targeted help. |
-
| | The Asset Manager is a fully customizable way of letting users select and execute scripts in a drag-and-drop fashion. At its simplest, it provides a way to collect together clipart and boilerplate text. At the other end of the spectrum, it can host ActiveX controls, for example to provide a browsing interface into a document management system. |
|