[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

Interaction of initial structure pattern and table format



I ran into an interesting XML import bug today (FM 7.0, Windows). The XML representation of a table need not account for all the table component elements that are required in the FM equivalent. For example, markup such as:

<table cols="4">
<row></row>
</table>

may result in the FM structure

(table)
  |--(body)
       |--(row)
             |--(cell)
             |--(cell)
             |--(cell)
             |--(cell)

even though the XML markup does not explicitly contain a table body element or the various cell elements. In fact, the different "implied" cell elements may have different tags. The same markup fragment could result in:

(table)
  |--(body)
       |--(row)
             |--(city)
             |--(county)
             |--(state)
             |--(population)

Tags for elements automatically created as part of the inherent structure of a table are specified in the EDD in the initial structure pattern for the row element. In the above case, suppose the initial structure pattern is "city, county, state, population, altitude, rainfall". If the table has 6 or fewer columns, cells along the row are tagged with successive names from the initial structure pattern. If there are more than 6 columns, the 7th and succeeding columns repeat the last tag in the initial structure pattern ("rainfall" in this case).

Another aspect of table tagging and formatting is the table format. One property stored in a table format is the initial number of columns. This is the number to which the Columns text box in the Insert Table dialog box is initialized when you insert a new table of the specified format. It is set when you create a table format and can be changed by updating the table format from a table with a different number of columns or by changing the number of columns when inserting a table of the specified format.

The bug is that when importing a table from XML, FM does not use all of the initial structure pattern if the table has more than the initial number of columns. It uses successive tags from the initial structure pattern until it has tagged the initial number of cells, and then repeats the last of those tags for any remaining cells. Suppose the initial number of columns is 3 and FM is importing a row of a 6-column table that has the initial structure pattern is "city, county, state, population, altitude, rainfall". Instead of the expected "city, county, state, population, altitude, rainfall" cells, FM creates "city, county, state, state, state, state". An easy workaround, of course, is to make sure the initial number of columns is at least as big as the number of tags specified in the initial structure pattern.

Note that this problem does not occur when editing interactively. If you insert a 6-column table from the user interface using the above table format and initial structure pattern, FM uses all 6 tags in the initial structure pattern.

--Lynne





Lynne A. Price
Text Structure Consulting, Inc.
Specializing in structured FrameMaker consulting, application development, and training
lprice@xxxxxxxxxxxx http://www.txstruct.com
voice/fax: (510) 583-1505 cell phone: (510) 421-2284




** To unsubscribe, send a message to majordomo@xxxxxxxxx **
** with "unsubscribe framers" (no quotes) in the body.   **