# eric4.E4XML.XMLWriterBase

Module implementing a base class for all of eric4s XML writers.

### Global Attributes

None

### Classes

XMLWriterBase | Class implementing a base class for all of eric4s XML writers.

### Functions

None

## XMLWriterBase

Class implementing a base class for all of eric4s XML writers.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

XMLWriterBase | Constructor
_write | Protected method used to do the real write operation.
_writeBasics | Protected method to dump an object of a basic Python type.
_write_bool | Protected method to dump a BooleanType object.
_write_complex | Protected method to dump a ComplexType object.
_write_dictionary | Protected method to dump a DictType object.
_write_float | Protected method to dump a FloatType object.
_write_int | Protected method to dump an IntType object.
_write_list | Protected method to dump a ListType object.
_write_long | Protected method to dump a LongType object.
_write_none | Protected method to dump a NoneType object.
_write_string | Protected method to dump a StringType object.
_write_tuple | Protected method to dump a TupleType object.
_write_unicode | Protected method to dump an UnicodeType object.
_write_unimplemented | Protected method to dump a type, that has no special method.
encodedNewLines | Public method to encode newlines and paragraph breaks.
escape | Function to escape &, <, and > in a string of data.
writeXML | Public method to write the XML to the file.

### Static Methods

None

#### XMLWriterBase (Constructor)

XMLWriterBase(file)

Constructor

file
  open file (like) object for writing

#### XMLWriterBase._write

_write(s, newline = True)

Protected method used to do the real write operation.

s
  string to be written to the XML file
newline
  flag indicating a linebreak

#### XMLWriterBase._writeBasics

_writeBasics(pyobject, indent = 0)

Protected method to dump an object of a basic Python type.

pyobject
  object to be dumped
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_bool

_write_bool(value, indent)

Protected method to dump a BooleanType object.

value
  value to be dumped (boolean)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_complex

_write_complex(value, indent)

Protected method to dump a ComplexType object.

value
  value to be dumped (complex)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_dictionary

_write_dictionary(value, indent)

Protected method to dump a DictType object.

value
  value to be dumped (dictionary)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_float

_write_float(value, indent)

Protected method to dump a FloatType object.

value
  value to be dumped (float)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_int

_write_int(value, indent)

Protected method to dump an IntType object.

value
  value to be dumped (integer)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_list

_write_list(value, indent)

Protected method to dump a ListType object.

value
  value to be dumped (list)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_long

_write_long(value, indent)

Protected method to dump a LongType object.

value
  value to be dumped (long)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_none

_write_none(value, indent)

Protected method to dump a NoneType object.

value
  value to be dumped (None) (ignored)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_string

_write_string(value, indent)

Protected method to dump a StringType object.

value
  value to be dumped (string)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_tuple

_write_tuple(value, indent)

Protected method to dump a TupleType object.

value
  value to be dumped (tuple)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_unicode

_write_unicode(value, indent)

Protected method to dump an UnicodeType object.

value
  value to be dumped (unicode)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase._write_unimplemented

_write_unimplemented(value, indent)

Protected method to dump a type, that has no special method.

value
  value to be dumped (any pickleable object)
indent
  indentation level for prettier output (integer)

#### XMLWriterBase.encodedNewLines

encodedNewLines(text)

Public method to encode newlines and paragraph breaks.

text
  text to encode (string or QString)

#### XMLWriterBase.escape

escape(data, attribute=False)

Function to escape &, <, and > in a string of data.

data
  data to be escaped (string)
attribute
  flag indicating escaping is done for an attribute

Returns:
  the escaped data (string)

#### XMLWriterBase.writeXML

writeXML()

Public method to write the XML to the file.

Up