Next / Previous / Contents / Shipman's homepage

15.9. Hier.writeXML(): Generate XML

nomcompile3
# - - -   H i e r . w r i t e X M L

    def writeXML ( self, parent ):
        '''Generate an XML representation of self.
        '''

The root element of the subtree for a hierarchy is rankSet. Its children are rank elements that will be added by Section 16.3, “Rank.writeXML(): Generate XML”.

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

        #-- 2 --
        # [ rankSet  :=  rankSet with rnc.RANK_N elements added
        #       representing the ranks in self ]
        for rank in self:
            rank.writeXML ( rankSet )