ADM XML Handling¶
XML Parsing¶
- ear.fileio.adm.xml.load_axml_doc(adm, element, lookup_references=True, fix_block_format_durations=False)¶
Load some axml into an ADM structure.
This is a low-level function and doesn’t deal with common definitions.
- Parameters
adm (ADM) – ADM structure to add to
element (lxml.etree._Element) – parsed ADM XML
lookup_references (bool) – should we look up references?
fix_block_format_durations (bool) – should we attempt to fix up inaccuracies in audioBlockFormat durations?
- ear.fileio.adm.xml.load_axml_string(adm, axmlstr, **kwargs)¶
Wrapper around
load_axml_doc()which parses XML too.- Parameters
adm (ADM) – ADM structure to add to
axmlstr (str) – ADM XML string
kwargs – see
load_axml_doc()
- ear.fileio.adm.xml.load_axml_file(adm, axmlfile, **kwargs)¶
Wrapper around
load_axml_doc()which loads XML from a file.- Parameters
adm (ADM) – ADM structure to add to
axmlfile (Union[str, File]) – ADM XML file name or file object; see
lxml.etree.parse().kwargs – see
load_axml_doc()
- ear.fileio.adm.xml.parse_string(axmlstr, **kwargs)¶
Parse an ADM XML string, including loading common definitions.
- Parameters
axmlstr (str) – ADM XML string
kwargs – see
load_axml_doc()
- Returns
ADM structure
- Return type
- ear.fileio.adm.xml.parse_file(axmlfile, **kwargs)¶
Parse an ADM XML file, including loading common definitions.
- Parameters
axmlfile (Union[str, File]) – ADM XML file name or file object; see
lxml.etree.parse().kwargs – see
load_axml_doc()
- Returns
ADM structure
- Return type
XML Generation¶
- ear.fileio.adm.xml.adm_to_xml(adm)¶
Generate an XML element corresponding to an ADM structure.
This skips elements marked with is_common_definition
- Parameters
adm (ear.fileio.adm.adm.ADM) –
- Return type