Skip to content

append() argument must be xml.etree.ElementTree.Element, not lxml.etree._Element #50

@T-K-233

Description

@T-K-233

Get the following error when trying to insert a Python dictionary to element tree.

  ...
    xml_data = xmljson.gdata.etree(robot.json, root=xml.etree.ElementTree.Element("root"))
  File "D:\Documents\Python310\lib\site-packages\xmljson\__init__.py", line 135, in etree
    result.append(elem)
TypeError: append() argument must be xml.etree.ElementTree.Element, not lxml.etree._Element

robot.json is formatted with GData format. The data in this particular case is

robot.json = {'link': {'name': 'part_2', '$t': {}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions