This method attaches one or more
elements to the given
# - - - N a r r a t i v e . w r i t e N o d e def writeNode(self, parent): """Output self's content as XML. """
Normally the content is a sequence of
Paragraph instances. In that case, all we need
to do is to call the
for each of those instances. See Section 19.4, “
Paragraph.writeNode(): Write as
When the instance's content is only a single para, we
don't need to wrap the output in a
element, so we bypass the addition of this node and
directly use Section 19.5, “
Paragraph.writeContent(): Write the
content of a paragraph”.
#-- 1 -- if len(self._paraList) > 1: #-- 1.1 -- # [ parent := parent with XML added for each element # of self._paraList ] for para in self._paraList: para.writeNode(parent) elif len(self._paraList) == 1: #-- 1.2 -- # [ parent := parent with XML added for the first # element of self._paraList ] solePara = self._paraList solePara.writeContent(parent)