The generated th element is connected with the
stylesheet using the class defined in Section 13.4.11, “CLASS_CENSUS_ROW_LABEL”. There are two cases:
When the BirdId is a simple form, we get
the corresponding Taxon and use its .engHtmlSubeltComma() method to format the name
as XHTML. See Section 36.3, “CensusRowLabel._htmlSimple()”. Example:
<td class='crl'>
Raven, Chihuahuan
</th>
When the form is compound, we use a stack of two div elements. The first div
contains the first form code's Taxon,
formatted by .engHtmlSubeltComma(), and the
second contains the BirdId.rel code
followed by one space and the second form code's formatted
name. See Section 36.4, “CensusRowLabel._htmlCompound()”.
Example:
<td class='crl'>
<div>
Raven, Chihuahuan
</div>
<div>
/ Raven, Common
</div>
</th>
# - - - C e n s u s R o w L a b e l . h t m l
def html(self, sox, **kw):
'''Render self as XHTML.
'''
#-- 1
# [ sox +:= a td et.Element with CLASS_CENSUS_ROW_LABEL
# td := the sox.Elt for that element ]
td = sox.start("td", CLASS_CENSUS_ROW_LABEL, kw, valign='top')
#-- 2
# [ if birdId.rel == abbrMod.REL_SIMPLE ->
# if birdId.abbr is defined in self.birdId.txny ->
# sox +:= the Taxon for birdId.abbr, formatted as XHTML
# in inverted order
# else -> raise ScriptError
# else if birdId.abbr and birdId.abbr2 are both defined in
# birdId.txny ->
# sox +:= (a div containing the Taxon for birdId.abbr,
# formatted as XHTML in inverted order) + (a div
# containing birdId.rel + (' ') + the Taxon for
# birdId.abbr2, formatted as XHTML)
# else -> raise ScriptError ]
if self.birdId.rel.strip() == '':
self._htmlSimple(sox)
else:
self._htmlCompound(sox)
#-- 3
td.end()