Package flumotion :: Package common :: Module xmlwriter :: Class XMLWriter
[hide private]

Class XMLWriter

source code

object --+
         |
        XMLWriter
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_calcAttrsLength(self, attributes, indent) source code
 
_collectAttributes(self, attributes, indent=-1) source code
 
_openTag(self, tagName, attributes=None) source code
 
_closeTag(self, tagName) source code
string
getXML(self)
Fetches the xml written by the writer
source code
 
writeLine(self, line='')
Write a line to the xml.
source code
 
writeTag(self, tagName, attributes=None, data=None)
Writes out and closes a tag.
source code
 
pushTag(self, tagName, attributes=None)
Push a tag:
source code
 
popTag(self)
Decreases the indentation and closes the previously opened tag.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

getXML(self)

source code 

Fetches the xml written by the writer

Returns: string
the xml

writeLine(self, line='')

source code 

Write a line to the xml. This method honors the current indentation.

writeTag(self, tagName, attributes=None, data=None)

source code 

Writes out and closes a tag. Optionally writes data as a child node.

Parameters:
  • tagName - name of the tag
  • attributes - attributes or None
  • data - data or None

pushTag(self, tagName, attributes=None)

source code 

Push a tag:

 - writes the tag and the attributes
 - increase the indentation for subsequent calls
Parameters:
  • tagName (string) - name of the tag to write
  • attributes (list of 2 sizes tuples; (name, value)) - attributes to write

popTag(self)

source code 

Decreases the indentation and closes the previously opened tag.

Returns:
name of the closed tag