Next / Previous / Contents / TCC Help System / NM Tech homepage

36.5. CensusRowLabel.fo()

This method renders a census row label as a table-cell element marked up using the style defined in Section 13.11.8, “FO_CENSUS_ROW_LABEL_ATTRS. As in Section 36.2, “CensusRowLabel.html(), the rendering depends on whether it is a simple or compound name. In the latter case we stack the first name, wrapped in a block element, on top of another block element that contains the relationship code and the second name. In any case, the number-rows-spanned attribute is added, if necessary, by Section 33.4, “RowLabel.foRowSpan().

cbchistlib.py
# - - -   C e n s u s R o w L a b e l . f o

    def fo(self, s, spanCount):
        '''Render self as XSL-FO.
        '''
        #-- 1
        # [ s  +:=  an open table-cell element
        #   cell  :=  that element ]
        cell = s.start('table-cell', FO_CENSUS_ROW_LABEL_ATTRS,
                       self.foRowSpan(spanCount))

See Section 36.6, “CensusRowLabel._foSimple(): Render a simple name as XSL-FO” and Section 36.7, “CensusRowLabel.foCompound() for those two cases.

cbchistlib.py
        #-- 2
        # [ if self.birdId is a simple form defined in
        #   self.birdId.txny ->
        #     s  +:=  a block element containing the English name
        #             for self.birdId.abbr as XSL-FO
        #   else if self.birdId is a compound form defined in
        #   self.birdId.txny ->
        #     s  +:=  (a block element containing the English name for
        #         self.birdId.abbr as XSL-FO) + (a block element
        #         containing self.birdId.rel and the English name for
        #         self.birdId.abbr as XSL-FO)
        #   else -> raise ScriptError ]
        if self.birdId.rel.strip() == '':
            self._foSimple(s)
        else:
            self._foCompound(s)

        #-- 3
        # [ s  +:=  cell, closed ]
        cell.end()

Note

MySQL deblanks the .rel field, which is why we need a more general test above.