且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Python的ElementTree在属性名称中转义冒号?

更新时间:2022-06-20 04:06:37

可能对您有用。
链接

>>> root = ET.Element("databaseConfiguration", {"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance", "xsi:noNamespaceSchemaLocation":"database.xsd"})
>>>