Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

29 Working with FrameMaker markers > 29.7 Inserting code or text with markers > 29.7.3 Processing marker content as text for XML/HTML/XHTML


29.7.3 Processing marker content as text for XML/HTML/XHTML

For most output types, Mif2Go processes FrameMaker Index markers for their usual purpose. However, for generic XML or HTML/XHTML output, Mif2Go makes no assumptions about the meaning of Index markers. If you wish to have the content of FrameMaker Index markers included in output as, for example, <indexterm> elements, you must direct Mif2Go to surround the marker content with appropriate tags; see §29.7.2 Surrounding marker content with code.

For example:

[MarkerTypeCodeBefore]

Index = <indexterm>

[MarkerTypeCodeAfter]

Index = </indexterm>

Special characters in marker content

Suppose some of your FrameMaker Index markers happen to include text surrounded by angle brackets, such as this example:

\<a name=...\> tags

For generic XML output, with the above code-before and code-after settings, Mif2Go would render this marker content as:

<indexterm><a name=...> tags</indexterm>

This is not valid XML; what you really want in generic XML output is this:

<indexterm>&lt;a name=...&gt; tags</indexterm>

To achieve the correct encoding of the angle brackets you must create a new marker type, cloning (and replacing) existing markers of type Index, and assigning the Text property to the new marker type. For example:

[Markers]

; Clone and replace markers of type Index:

Index = NewIndex

(When you specify Index=NewIndex, rather than Index=Index NewIndex, the original Index markers are no longer in effect for conversion purposes.)

[MarkerTypes]

; Assign the Text property to markers of type NewIndex:

NewIndex = Text

[MarkerTypeCodeBefore]

; Precede the content of each NewIndex marker with an opening tag:

NewIndex = <indexterm>

[MarkerTypeCodeAfter]

; Follow the content of each NewIndex marker with a closing tag:

NewIndex = </indexterm>

Because you have assigned the Text property to markers of type NewIndex, Mif2Go treats the marker content as plain text, and applies the appropriate encoding to non-alphanumeric characters.

Note:  You do not need this approach for DITA or DocBook XML output, nor for any of the Help output types, nor for RTF output.

See also:

§14.8.1 Configuring index markers for conversion to XML



29 Working with FrameMaker markers > 29.7 Inserting code or text with markers > 29.7.3 Processing marker content as text for XML/HTML/XHTML