Module xml
source code
Module containing generic functions for creation and parsing of XML
representations of Python objects.
|
|
|
|
|
|
|
xml_to_object(elem,
base_object=None,
set_fn=None,
file_version=1,
blacklist=[ ] )
Convert the XML elements into python objects, and place these into
the base object. |
source code
|
|
Imports:
numpy,
set_printoptions,
array,
inf,
nan,
ndarray,
zeros,
search,
lib,
floatAsByteArray,
packBytesAsPyFloat,
RelaxError
fill_object_contents(doc,
elem,
object=None,
blacklist=[ ] )
| source code
|
Place all simple python objects into the XML element namespace.
- Parameters:
doc (xml.dom.minidom.Document instance) - The XML document object.
elem (XML element object) - The element to add all python objects to.
object (instance) - The python class instance containing the objects to add.
blacklist (list of str) - A list of object names to exclude.
|
Convert the node value to a python expression.
- Parameters:
elem (xml.dom.minidom.Element instance) - The XML element.
|
Convert the given value into an XML form.
- Parameters:
doc (xml.dom.minidom.Document instance) - The XML document object.
elem (XML element object) - The element to add the Python objects to.
value (anything) - The Python object to convert.
|
xml_to_object(elem,
base_object=None,
set_fn=None,
file_version=1,
blacklist=[ ] )
| source code
|
Convert the XML elements into python objects, and place these into the
base object.
- Parameters:
elem (xml.dom.minidom.Element instance) - The element to extract all python objects from.
base_object (instance) - The python class instance to place the objects into.
set_fn (function) - A function used to replace setattr for placing the object into
the base object.
file_version (int) - The relax XML version of the XML file.
blacklist (list of str) - A list of object names to exclude.
|