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

14.6. Document.write()

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

xml4create.py
# - - -   D o c u m e n t . w r i t e   - - -

    def write ( self, outFile=None ):
        """Prettyprint self in XML to outFile.

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

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

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