更新时间:2022-06-20 04:06:37
可能对您有用。 从链接
>>> root = ET.Element("databaseConfiguration", {"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance", "xsi:noNamespaceSchemaLocation":"database.xsd"}) >>>
如何使用Python的ElementTree在属性名称中转义冒号?
如何在python中使用ElementTree访问包含名称空间的xml中的属性值