sarkit.xmlhelp.XmlHelper

class XmlHelper(element_tree, xsdhelper)

Base Class for generic XmlHelpers, which provide methods for transcoding data between XML and more convenient Python objects.

Parameters:
element_treelxml.etree.ElementTree

An XML element tree containing the data being operated on.

xsdhelperXsdHelper

XsdHelper object corresponding to element_tree’s schema

Methods

load(pattern)

Find and load the first subelement matching pattern in element_tree.

load_elem(elem)

Decode elem (an XML element) to a Python object.

set(pattern, val)

Find and set the first subelement matching pattern in element_tree using val.

set_elem(elem, val)

Encode val (a Python object) into the XML element elem.