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?

    Note

    This is deprecated; use the functions in ear.fileio.adm.timing_fixes instead.

ear.fileio.adm.xml.load_axml_string(adm, axmlstr, **kwargs)

Wrapper around load_axml_doc() which parses XML too.

Parameters
ear.fileio.adm.xml.load_axml_file(adm, axmlfile, **kwargs)

Wrapper around load_axml_doc() which loads XML from a file.

Parameters
ear.fileio.adm.xml.parse_string(axmlstr, **kwargs)

Parse an ADM XML string, including loading common definitions.

Parameters
Returns

ADM structure

Return type

ADM

ear.fileio.adm.xml.parse_file(axmlfile, **kwargs)

Parse an ADM XML file, including loading common definitions.

Parameters
Returns

ADM structure

Return type

ADM

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

lxml.etree._Element