This method converts self to a new floc node.
# - - - S i g h t i n g . w r i t e N o d e
def writeNode(self, formNode):
"""Convert self to XML.
[ formNode is an et.Element ->
formNode +:= a new rnc.FLOC_N child made from self ]
"""
First, attach the new node.
#-- 1 --
# [ formNode := formNode with a new rnc.FLOC_N child added
# flocNode := that new child ]
flocNode = et.SubElement(formNode, rnc.FLOC_N)
There are three content groups, each with a corresponding method that translates it to XML.
For age-sex-group, see Section 15.3, “AgeSexGroup.writeNode()”.
For loc-group, see Section 14.4, “LocGroup.writeNode(): Translate to
XML”.
For sighting-notes, see Section 16.6, “SightNotes.writeNode()”.
#-- 2 --
# [ if self.ageSexGroup ->
# flocNode +:= age-sex-group content from
# self.ageSexGroup
# else -> I ]
if self.ageSexGroup:
self.ageSexGroup.writeNode(flocNode)
#-- 3 --
# [ simile ]
if self.locGroup:
self.locGroup.writeNode(flocNode)
#-- 4 --
if self.sightNotes:
self.sightNotes.writeNode(flocNode)