Elements at two levels—form and
floc—share the need to display
two kinds of data that can be attached at either level:
loc-group content and sighting-notes content. A third type of
content, age-sex-group, can appear at
either level in the XML input, but in the representation
provided by the birdnotes.py module, it is always
attached to the Sighting child of the
BirdForm element.
The overall rendering of an input form
element depends on whether it is the single-sighting or
multi-sighting case:
In the single-sighting case, let us refer to that
single sighting as . There is only one Sdiv at the top level, and it looks
schematically like this.
<div class='form'>
<span class='bird-name'>Greater Roadrunner</span>
S.age-sex-group
S.loc-group
S.sighting-notes
</div>
where the loc-group and sighting-notes are rendered in separate
div elements, but the age-sex-group follows the bird name on the
same line.
In this case, the loc-group may be
inherited all or partially from the day-notes parent.
In the multiple-sighting case, here is a schematic of
the rendering, where is the Fform
input element and is a child sighting element.
S
<div class='form'>
<span class='bird-name'>Greater Roadrunner</span>
F.loc-group
F.sighting-notes
<div class='floc'>
S.age-sex-group
S.loc-group
S.sighting-notes
</div>
<div class='floc'>
...
</div>
...
</div>
In this case, the part appears only
if there is an explicit F.loc-group.locGroup
attribute on . There is no point in using the inherited
value, since the inherited parts will be displayed
in the child sightings, combined with any explicit
locality data in the children.
F
Here are some notes on the rendering of these various elements.
If there is a count in the age-sex-group, it is copied to the XHTML, followed by a space.
If there is an age code, it is copied directly,
except that code “p” is
converted to a Greek lowercase phi, φ, as
entity reference “φ”.
If there is a sex code, it is copied directly.
If the countability code is “?”, it is copied directly; countability code
“-” is rendered as
“[uncountable]”.
If the record is fide some other observer, that is rendered as
“[<span
class='genus'>fide</span> ”, where N] is the
observer's name. Although the word fide is not technically a genus
name, it falls under the same rule: italicize Latin
words.
N
The locality-group, materialized as a
LocGroup instance, generates both
inline and block content.
There is always a locality code, explicit or
inherited, and we translate that to the
corresponding full name, preceded by an
“@” sign.
If there is a GPS waypoint,
we generate the inline text “GPS=...”.
If there is loc-detail content, it
is rendered in a separate div with
class='loc-child'. For the
associated CSS rule, see Section 5.7, “div.loc-child: Indented child
block”.
For the rendering of the various sighting-notes elements, see Section 4.11, “XHTML rendering of sighting notes”.