Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

15 Converting to DITA XML > 15.4 Configuring DITA elements > 15.4.3 Mapping paragraph formats to DITA block elements > 15.4.3.8 Mapping paragraph format aliases algorithmically


15.4.3.8 Mapping paragraph format aliases algorithmically

Suppose you use the same paragraph formats for numbered lists (for example, NumFirst and NumNext) both in material for <concept> topics and in material for <task> topics:

When the list occurs in a <concept>, it should be mapped to ol > li.

When the list occurs in a <task>, it should be mapped to steps > step > cmd.

To choose between alternate format aliases depending on the DITA context, you can assign to a FrameMaker format a Mif2Go macro that selects an alias according to the start tag of the current topic. For example:

[DITAAliases]

NumFirst = <$(($$_ditastart is "task") ? "StepFirst" : "OLFirst")>

NumNext = <$(($$_ditastart is "task") ? "StepNext" : "OLNext")>

These assignments say that if the topic start tag is task, use the Step* format name, otherwise use the OL* format name, in place of the original Num* format name. The assignments use predefined macro variable $$_ditastart, which contains the start tag of the current DITA topic.

You would assign the desired DITA elements to the alternate format names. For example:

[DITAParaTags]

Step* = step

OL* = li

You would also create entries for the alternate formats in [DITAParents], and if needed in [DITALevels], and so forth. In effect, you have created semantic formats from descriptive format.s.

The macros you assign do not have to select based on topic type; you can set macro variables to test for other properties or situations. The ability to assign a macro to a format name provides a general-purpose algorithmic way to map from FrameMaker formats to DITA elements, allowing you to deal with cases that normal mapping cannot handle.



15 Converting to DITA XML > 15.4 Configuring DITA elements > 15.4.3 Mapping paragraph formats to DITA block elements > 15.4.3.8 Mapping paragraph format aliases algorithmically