instance_to_xml¶
-
InventoryXmlParser.
instance_to_xml
(instance, root, name, attributes, tags, attr_map, converter, element_handler={})[source]¶ Translate an inventory object into a xml element.
- Parameters
instance (object) – An instance of a
mss_dataserver.geometry.inventory
class.root (
etree.Element
oretree.Subelement
) – The XML root.name (str) – The name of the XML element.
attributes (
list
of str) – The attributes of the XML element.tags (
list
of str) – The tags of the XML element.attr_map (
dict
) – The mapping of the XML attributes to instance attributes.converter (
dict
) – A dictionary with functions used to convert attributes before adding them to the XML element.element_handler (
dict
) – A dictionary with functions used to handle attributes before adding them to the XML element. A handler can be used if a simple conversion using the converter is not sufficient.
- Returns
The created XML element.
- Return type
etree.SubElement