Hazard Statement Publishing Options

To render hazardstatement elements for publishing, the default DITA elements are wrapped in a table structure made up of a number of special fm-* elements.

Note: The fm-* elements mentioned here are described in DITA-FMx Specific Book Application Elements.

The hazard table wrapping of hazardstatement elements is performed by default if the special fm-* elements exist in the Book structure application. To prevent this process from running, in the bookbuild INI, set BookBuildOverrides/HazardToTable=0.

DITA-FMx supports two styles of hazard tables. One style has a full-width header and a row below with two cells, one for the hazard symbol and the other for the hazard information (messagepanel structure). The other style has a partial-width header where the hazard symbol is in the first column, and the header and content in the second column (this is the default style in the DITA-FMx Book templates).

Figure 1. Full-width header hazard table style

Figure 2. Partial-width header hazard table style (default)

During the hazard-to-table processing, each hazardstatement element is replaced with an fm-hazardtable element and the attributes are transfered from one to the other. Within the fm-hazardtable a fm-hazardtgroup element is inserted which inserts a “Hazard” table object. The default properties of this table controls the appearance of the resulting hazard tables. To create a full-width header table, the default layout should have 1 header row and 1 body row, with 2 columns. For a partial-width header table, set up the default table layout with no header rows, 2 body rows and 2 columns.

Figure 3. Structural model after hazard-to-table processing

The header background coloring is controlled by a custom color definition named based on the hazardstatement/@type attribute. Create a custom color for each @type value you plan to use. These colors should use the naming convention of “hazard-TYPE” (where “TYPE” is the value of the type attribute). Hazard statements without a type attribute value will use a color named “hazard.”

The formatting and text of the header label is also tied to the type attribute. A paragraph tag is applied to the fm-hazardhead element using the naming convention of “hazard.head.TYPE” (and “hazard.head” for no type value). This paragraph tag defines an autonum prefix for each label for the header text.

The hazardsymbol element is inserted into the first column and wrapped in a fm-hazardsymbolwrapper element. This wrapper element is used even when there is no hazardsymbol element to allow custom formatting if needed. For the partial-width header table, the top, left, and bottom rulings are set to “None” for the first column, effectively making the symbol separate from the content table.

The maximum width of hazardsymbol images is controlled by the Max Symbol Width setting in the Authoring Options dialog. To override this for a book build, use the BookBuildOverrides/HazardSymbolMaxWidth parameter.

The messagepanel element (and children) are inserted into the second cell in the second row. Additional messagepanel elements are inserted into extra rows in the table. Use typical EDD/template formatting techniques for the messagepanel elements.

If you are using the full-width header tables and want to create separate table formats for each hazard type, you can use the header background color defined in the default format rather than creating custom color definitions. To do this, in the bookbuild INI set BookBuildOverrides/UseColorFromTable=1.

The default DITA-FMx Book application and component templates all have the necessary settings, objects, and element definitions to render the partial-width header hazard tables (this format appears to be the most “standard”). If you’d like to test the full-width header style, locate the tpl~topicref-HAZALT.fm file in the Book application’s component-templates folder. This file contains the styles and objects that will create a full-width header style hazard table. If you’ve enabled the “Component Templates” book-build option, and your component map element types are “topicrefs” you can swap this file for the default topicref component template. Or, if needed, rename it to be a chapter component template. To set up other templates, you’ll need to copy and paste the Hazard table into that template as well as transfer the color definitions and paragraph definitions.