XMLElement

class compas.files.XMLElement(tag, attributes=None, elements=None, text=None)[source]

Bases: object

Class representing an XML element in the tree.

Parameters
  • tag (str) – The type of XML tag.

  • attributes (dict[str, Any], optional) – The attributes of the tag as name-value pairs.

  • elements (list[XMLElement], optional) – A list of elements contained by the current element.

  • text (str, optional) – The text contained by the element.

Methods

add_children

Add children to an element.

get_root

Get the root element.