Package pyxsd :: Package writers :: Module xmlTreeWriter :: Class XmlTreeWriter
[hide private]
[frames] | no frames]

Class XmlTreeWriter

source code

object --+
         |
        XmlTreeWriter

Instance Methods [hide private]
  __init__(self, root, output)
Initialize the writer.
  writeHeaderInfo(self)
Writes a comment at the top of the file with the creation information.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Static Methods [hide private]
  passTagToTagWriter(element, tabs, output)
Extracts element variables and initializes the tag writer for the element.

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, root, output)
(Constructor)

source code 

Initialize the writer.

Parameters:

  • root: The root instance of a tree. Must be formatted in program's tree structure.
  • output: The file object to write the tree to.
Overrides: object.__init__

passTagToTagWriter(element, tabs, output)
Static Method

source code 

Extracts element variables and initializes the tag writer for the element. Recursively calls itself on its element children. Writes the ending tag if it has any values or any children.

Parameters: - element: An element instance that follows the program's tree structure. - tabs: An integer that specifies how many tabs preceed an element. Starts at zero for the root element. - output: The file object to write the tree to.

writeHeaderInfo(self)

source code 

Writes a comment at the top of the file with the creation information. Includes data and time information.

Takes no arguments