Next / Previous / Contents / TCC Help System / NM Tech homepage

14.5. Document.serialize()

This method outputs the document tree to the given stream, defaulting to sys.stdout.

xml4create.py
# - - -   D o c u m e n t . s e r i a l i z e   - - -

    def serialize ( self, outFile=None ):
        """Serialize self in XML to outFile.

          [ (domlette is Ft.Xml.domlette) and
            (outFile is a writeable file handle, defaulting to
            sys.stdout) ->
              outFile  +:=  a serialized XML representation of self ]
        """

        #-- 1 --
        if  outFile is None:
            outFile  =  sys.stdout

        #-- 2 --
        # [ outFile  +:=  an XML rendering of self.node ]
        domlette.Print ( self.node, outFile )