Utils¶
Module containing utility functions
-
class
bertlv.utils.
XmlSettings
(indent: str = ' ', newl: str = '\n', encoding: str = 'utf-8')[source]¶ Bases:
object
XML settings as expected by the method
toprettyxml()
.
-
bertlv.utils.
xml_prettify
(string: str, settings: bertlv.utils.XmlSettings = XmlSettings(indent=' ', newl='\n', encoding='utf-8')) → bytes[source]¶ Return a pretty-printed XML byte-string for the raw XML string.
-
bertlv.utils.
xml_prettify_element
(element: xml.etree.ElementTree.Element, settings: bertlv.utils.XmlSettings = XmlSettings(indent=' ', newl='\n', encoding='utf-8')) → bytes[source]¶ Return a pretty-printed XML byte-string for the element.
-
bertlv.utils.
xml_text2hex
(element: xml.etree.ElementTree.Element) → bytes[source]¶ Return a byte-string from the hexadecimal element text.