Package data :: Module relax_xml
[hide private]
[frames] | no frames]

Module relax_xml

source code

Module containing generic fns for creation and parsing of XML representations of python objects.

Functions [hide private]
 
fill_object_contents(doc, elem, object=None, blacklist=[])
Place all simple python objects into the XML element namespace.
source code
 
node_value_to_python(elem)
Convert the node value to a python expression.
source code
 
xml_to_object(elem, base_object=None, set_fn=None, blacklist=[])
Convert the XML elements into python objects, and place these into the base object.
source code
Variables [hide private]
  __package__ = 'data'

Imports: set_printoptions, array, float32, float64, inf, nan, float16, float128, search, strip, floatAsByteArray, packBytesAsPyFloat


Function Details [hide private]

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.

node_value_to_python(elem)

source code 

Convert the node value to a python expression.

Parameters:
  • elem (xml.dom.minidom.Element instance) - The XML element.

xml_to_object(elem, base_object=None, set_fn=None, 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.
  • blacklist (list of str) - A list of object names to exclude.