[Inso Home Page] [Home] [Collection] [Book] [Expand] [Collapse] [Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] [Preferences] [Print] [Help]

 inside  Expand Search


   Creating a dynaweb.wv Stylesheet   [Table of Contents]    Mapping HTML Lists

DynaWeb Publishers Guide

[-] 2. Publishing DynaText Books Using DynaWeb
[-] Assigning SGML Styles to HTML Groups

Assigning SGML Styles to HTML Groups

Purpose of this Section

This section provides a list of the basic tasks you will need to perform in order to map the styles contained in the newly created dynaweb.wv stylesheet to the HTML style groups.

The HTML Style Groups

The following table lists the supplied style groups and the HTML tags to which they refer. Each of the style groups shares its name with the HTML style (and tag) to which it refers.

Group Name

Definition

address

Address block

b

Bold-faced text

blockquote

Block quotation

br

Line break

cals-entry

Corresponds to <entry> tag in CALS tables.

cals-row

Corresponds to <row> tag in CALS tables.

cals-table

Corresponds to <table> tag in CALS tables.

cals-title

Corresponds to <title> tag in CALS tables.

cite

Citation text

code

Source code

dd

Definition of a term (in a definition list)

dir

Directory lists

dl

Definition list

dt

Term (in a definition list)

em

Emphasized text

h1 - h6

Header levels: h1 is the most significant, h6 the least.

hr

Horizontal dividing line

i

Italicized text

kbd

Keyboard-entry text

li

List item

menu

Menus

ol

Ordered list

p

Paragraph

pre

Preformatted text

samp

Literal character(s)

strong

Strong-emphasis text

tt

Fixed-width text

ul

Unordered list (also bulleted)

var

Variable-name text

Procedure for Assigning Groups Using InStEd

To assign SGML styles to HTML style groups and to customize the predefined style groups, use InStEd.

Perform the following steps for each style you want to assign to a group:

  1. Set a group for the selected style.

    From the View menu, select Group List. The Group List appears in the List pane (the upper left pane of the InStEd window); for example:

    Figure 2-1: Group Listing in InStEd

    raster

    Each grouped style is displayed beneath the name of its group. Ungrouped styles are displayed at the end of the list.

    Using the Group List makes it easy to see which DynaText group assignments exist. Evaluating the effect of DynaText group assignments may be worthwhile, because assigning a style to a different group obviates any previous group assignments. Before changing the group assignment of a style, you may want to modify the style to replicate some or all of the property values of the DynaText group.

    Note: If you are not interested in the pre-existing group assignments, you might prefer to access style names by using the Style List. This displays all the styles together in alphanumeric order.

  2. From the list, select a style (by double clicking on its name).
  3. To assign a group to the selected style, from the Style menu, select Set Group.

    Note: You can place many styles in the same group. But you can assign each style to only one group.

  4. Optionally, verify the effects of assigning a style to a group. Select View|Style List. This displays all the styles together in alphanumeric order in the List pane. You can select any style whose group setting you want to view; for example, to view the effect of assigning the CHAPTER,TITLE style to the h2 group, select that style in the Style List, as follows:

    Figure 2-2: CHAPTER,TITLE Selected in Style List

    raster

    InStEd highlights the style name in the List pane. In the Preview pane (lower left of window), it highlights the next element belonging to the selected style, as follows:

    Figure 2-3: CHAPTER,TITLE Element Selected By InStEd

    raster

    By inspecting the highlighted element, you can see the effects of the style's group assignment. For the h2 group assignment in this example, notice that the h2 end tag (</h2>) appears, but the begin tag (<h2>) is missing. In this case, you would need to modify the style definition to complete the group assignment.

    Because the Preview pane displays several elements at once, you can often inspect the effects of several group assignments without having to select the styles. In this example, for instance, you can also view the effects of h3 and p group assignments. These assignments have correctly inserted the tags of the corresponding HTML h3 and p elements (the p element does not require an end tag).

    Note: If you double click on a style name in any list, InStEd displays the style's properties in one of the three Definition Forms (right side of window), where you can view and edit the style's properties

    Repeat this process for each style that you are assigning to a group. This completes the minimal amount of set-up work for a conversion stylesheet.

    Assigning Styles to HTML Groups without InStEd

    In order to assign your SGML styles to HTML style groups, you will need to decide which HTML styles best represent the styles you were using in your DynaText book.

    To add the style to one of the existing HTML groups, add the argument 'group="{groupname}" ', where {groupname} is the name of the group you wish the style to be a member of, directly after the style declaration:

    <style name="PARA" group="p"> </style>

    This allows the "PARA" style to use the "p" group's text-before and text-after properties.

    You will need to do this with all of the styles you wish to add to the HTML style groups. Remember that if a style uses a PVF in text-before or text-after properties, you may not want to add that style to a style group because its PVF will be overwritten by the style group's properties.

    Converting SGML Containers

    Many SGML DTDs use the idea of containers. Containers are used to surround a section of the document and allow that portion to be manipulated as a single unit. HTML does not support the idea of containers except in specific cases, such as lists and tables. Because HTML has no containers, these styles have no direct equivalent in the HTML DTD. The only portion of the container style that can be mapped is the label or title of the container, which can be mapped to one of the Heading elements of HTML (h1 to h6). When viewed from the browser, the illusion is that the container structure has been retained, when actually only the labels stand to mark where the containers begin and end.

    Here is an example of an SGML container structure:

    <MAP>
       <TITLE>Vegetables</TITLE>
       <BLOCK>
         <LABEL>Green Vegetables</LABEL>
         <SUBBLOCK>
          <LABEL>Broccoli</LABEL>
          <P>Broccoli is a green vegetable.</P>
         </SUBBLOCK>
         <SUBBLOCK>
          <LABEL>Celery</LABEL>
           <P>Celery is also a green vegetable.</P>
         </SUBBLOCK>
       </BLOCK>
       <BLOCK>
         <LABEL>Yellow Vegetables</LABEL>
         <SUBBLOCK>
           <LABEL>Corn</LABEL>
           <P>Corn is the only yellow vegetable I can think of.</P>
         </SUBBLOCK>
       </BLOCK>
    </MAP>

    By specifying one of the containers used in the example above (map, block, or subblock) you can easily control how much of the information is shown or requested. Since HTML has no containers, the HTML generated from the above example would be as follows:

      <H1>Vegetables</H1>
         <H2>Green Vegetables</H2>
          <H3>Broccoli</H3>
           <P>Broccoli is a green vegetable.</P>
          <H3>Celery</H3>
           <P>Celery is also a green vegetable.</P>
        <H2>Yellow Vegetables</H2>
           <H3>Corn</H3>
            <P>Corn is the only yellow vegetable I can think of.</P> 

    The idea of the containers is kept through the retention of the titles, but the actual containers are not translated into HTML. Only the titles and labels of the containers are translated. Therefore, these are the only styles we need to assign to HTML style groups.

    Remember, if your container titles use any text-before or text-after strings of their own, you must modify those styles individually in order to retain the original attribute.

    The only containers recognized by HTML tagging are lists and tables. Later sections will deal with these containers individually.


       Creating a dynaweb.wv Stylesheet   [Table of Contents]    Mapping HTML Lists