14.4.1 Generating XML from an unstructured document
To use Mif2Go to organize paragraph elements into higher-level sections, you can specify XML tags for the start and end of each section. You can do this several ways; your choice depends on the existing structure of your FrameMaker document and the structure you want in XML. You can insert code with any or all of the following:
Code-before and code-after macros
For the code-before/code-after method, you might have to rename paragraph formats that start and end a section, to make them unique in their usage, much like renaming Heading1 to Heading1 First, Heading1 Top of Page, and so forth.The other two methods avoid such renaming, but require an edit in the FrameMaker document at each point where such additions are needed.
Code-before and code-after macros
Provide code in a [ParaStyleCodeBefore] macro for a particular paragraph format that always starts a section, and a [ParaStyleCodeAfter] macro for the paragraph format that ends the section; see:
§28.9.3 Surrounding or replacing text with code or macros.
Insert markers that contain either code or a macro reference; see:
§29.7 Inserting code or text with markers
§28.9.7 Using HTML Macro markers to invoke macros.
Dedicate a paragraph format to XML code, and use it to insert the code directly into your FrameMaker document, most likely with a condition applied; see:
§28.9.3 Surrounding or replacing text with code or macros.
Suppose you have run-in heading format RuninHead that is always followed by paragraph format RuninBody, and you want all such instances to come out like this in XML:
<label>Content of label...</label>
<info>Content of info...</info>
You could specify the following settings:
> 14 Converting to generic XML > 14.4 Providing XML tags and structure > 14.4.1 Generating XML from an unstructured document