Omni Systems, Inc. |  | Mif2Go User's Guide, Version 55 |  |  |  |  |

> 29 Working with FrameMaker markers > 29.7 Inserting code or text with markers > 29.7.5 Converting custom markers to attributes

### 29.7.5 Converting custom markers to attributes

Suppose your FrameMaker document consists of a catalog with tables of items, including descriptions and prices. Each price cell has a custom marker, Price; the content of each Price marker is the part number of the item. And suppose in DITA XML output you want each price cell to include the text of the price, and also a conref attribute with the part number as the attribute value. In other words, for each cell containing a price $xxx.xx and a Price marker with content nnnnn, the corresponding DITA table cell should look like the following:

<entry><p>

<ph conref="nnnnnn">$xxx.xx</ph>

</p></entry>

First you would assign the Code property to the Price markers (see Table 29-3):

[MarkerTypes]

Price = Code

Now you can surround the part number with the conref assignment:

[MarkerTypeCodeBefore]

Price = <ph conref="

[MarkerTypeCodeAfter]

Price = ">

To wrap the price text in the same <ph> element, how you proceed depends on whether the price values in the table have a unique paragraph format.

If the price text has a unique paragraph format (for example, CurrPrice):

[HTMLParaStyles]

CurrPrice = CodeEnd

[ParaStyleCodeEnd]

CurrPrice = </ph>

If the price text does not have a unique paragraph format, you would have to use a macro and a macro variable to identify cells that contain price values. For example, if price values use a general-purpose paragraph format named TableCell:

[HTMLParaStyles]

TableCell = CodeEnd

[ParaStyleCodeEnd]

TableCell = <$_if ($$isprice)></ph><$$isprice=0><$_endif>

Instead of just closing the conref assignment, you would also set the value of the macro variable to indicate this is a price cell:

[MarkerTypeCodeAfter]

Price = "><$$isprice=1>

You should initialize the macro variable:

[MacroVariables]

isprice=0

See §28 Working with macros.

> 29 Working with FrameMaker markers > 29.7 Inserting code or text with markers > 29.7.5 Converting custom markers to attributes

| Mif2Go User's Guide: 29.7.4 Surrounding attribute markers with code |  | Mif2Go User's Guide: 29.7.6 Including code to be executed before a topic |