windkit.io.wasp.parse_wwh_element#

windkit.io.wasp.parse_wwh_element(root, context='WWH element')[source]#

Parse the root element of a workspace inventory.

Only the .tag / .attrib / .find / .findall / .iter subset of the ElementTree interface is used, so both lxml.etree and xml.etree.ElementTree elements are accepted.

Parameters:
  • root (lxml.etree._Element or xml.etree.ElementTree.Element) – The <WaspHierarchyFile> root element of Inventory.xml.

  • context (str, optional) – Identifier used in error messages, typically the source file path.

Returns:

Dictionary with keys:

  • "format_version" : str

  • "lowest_compatible_format_version" : str or None

  • "saving_component" : str or None

  • "saved_at" : str or None

  • "members" : list of dict, one per WaspHierarchyMember in document order, so a member comes before its children. Each is the dict of parse_wwh_member_element() with two more keys: "parent" (index into members of the member whose ChildMembers holds it, or None) and "children" (list of indices).

Return type:

dict

Raises: