Next / Previous / Contents / Shipman's homepage

18.9. TaxaTree.writeXML(): Generate XML output

nomcompile3
# - - -   T a x a T r e e . w r i t e X M L

    def writeXML ( self, parent ):
        '''Build the XML taxonomic tree.
        '''

At this level, the XML is very simple. We attach to the parent an rnc.TAXONOMY_N element, then call the recursive tree builder Section 19.9, “Taxon.writeXML(): Recursive XML tree writer” to build the tree starting with self.root.

nomcompile3
        #-- 1 --
        # [ parent  :=  parent with a new rnc.TAXONOMY_N element
        #               added
        #   txRoot  :=  that new element ]
        txRoot = E ( rnc.TAXONOMY_N )
        parent.append ( txRoot )

        #-- 2 --
        # [ txRoot  :=  txRoot with rnc.TAXON_N elements added
        #       representing the tree rooted at self.root ]
        self.root.writeXML ( txRoot )