Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
行政 。. . . 行政
这是我的 xml 文件。当我使用 clear() 或 del 方法时,它将清除所有子节点并创建一个空白节点
<user/>
我怎样才能避免创建这个空白节点
当我使用 findall() 并尝试访问它的任何孩子时,它会出现问题
谁能给我一段代码来完全删除节点???
从父节点中删除匹配用户节点将适合这种情况。