Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

14 Converting to generic XML > 14.4 Providing XML tags and structure > 14.4.1 Generating XML from an unstructured document


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

FrameMaker markers

Special paragraph format

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.

FrameMaker markers

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.

Special paragraph format

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.

A brief example

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:

<labeledinfo>

   <label>Content of label...</label>

   <info>Content of info...</info>

</labeledinfo>

You could specify the following settings:

[ParaTags]

RuninHead=label

RuninBody=info

[HTMLParaStyles]

RuninHead=CodeBefore

RuninBody=CodeAfter

[ParaStyleCodeBefore]

RuninHead=<labeledinfo>

[ParaStyleCodeAfter]

RuninBody=</labeledinfo>



14 Converting to generic XML > 14.4 Providing XML tags and structure > 14.4.1 Generating XML from an unstructured document