Yelp

(The Help System)

db2html.entry

Parameters

$entry

The entry element to process

$colspecs

The colspec elements currently in scope

$spanspecs

The spanspec elements currently in scope

$colsep

Whether column separators are currently enabled

$rowsep

Whether column separators are currently enabled

$colpos

The output column position currently being considered

$colnum

The actual column number of $entry

$spanstr

The string representation of the row spans

This template processes a single entry element and generates td elements as needed. It then calls itself on the following entry element, adjusting parameters as necessary. Under certain conditions, this template may not be able to output a td element immediately. In these cases, it makes whatever adjustments are needed and calls itself or db2html.entry.implicit (which, in turn, calls this template again when it's finished).

Three parameters are used to determine whether a td element can be output. The $spanstr parameter provides infomation about row spans in effect from entries in previous rows; the $colpos parameter specifies which column we would output to if we created a td; and the $colnum parameter specifies which column this entry should be in, according to any relevant colspec or spanspec elemets.

There are two conditions that cause this template not to output a td element immediately: if the $spanstr parameter does not start with 0:, and if the $colpos parameter is less than the $colnum parameter.

The $spanstr parameter specifies the row spans in effect from entries in previous rows. As this template iterates over the entry elements, it strips off parts of $spanstr so that only the parts relevant to the entry are present. If $spanstr does not start with 0:, then an entry in a previous row occupies this column position. In this case, that value is removed from $spanstr, the $colpos parameter is incremented, and db2html.entry is called again. Additionally, since db2html.entry.colnum doesn't consider row spans, the $colnum parameter may be incremented as well.

If the $colpos parameter is less than the $colnum parameter, then the document has skipped entries by explicitly referencing a column. This is allowed in CALS tables, but not in HTML. To fill the blank spaces, we call db2html.entry.implicit, which outputs an empty td element spanning as many columns as necessary to fill in the blanks. The db2html.entry.implicit template then calls this template again with appropriate parameter values.

When this template is finally able to output a td element, it calculates appropriate values for the style and class attribute based on DocBook attributes on the entry, the relevant colspec or spanspec, and any relevant ancestor elements. It then calls itself on the following entry element to output the next td.