python - 最好使用 Python 比较两个 XML 文件
问题描述
对于任何额外的行,我需要比较两个具有相同结构的 XML 文件。下面的示例提供了一些详细信息:
文件 1:
<Log1> Some text here </Log1>
<Log2>
<Id1> Some text here </Id1>
<Id2> Some text here </Id2>
</Log2>
文件2:
<Log1> Some text here </Log1>
<Log2>
<Id1> Some text here </Id1>
<Id2> Some text here </Id2>
</Log2>
<Log3> Some text here </Log3>
我需要 diff 来确定 File2 中有一个额外的标签。在 Python 中这样做有效率吗?
解决方案
推荐阅读
- java - 在 CoordinatorLayot 中翻译后查看不可点击
- html - Magento2:表格边框和悬停
- database - 更改 PostgreSQL 数据驱动器的问题
- jenkins-pipeline - Nexusartifactuploader 批量上传多个工件
- javascript - 为什么 getElementById() 不能在 owl-carousel 中工作?
- c++ - pybind11中的问题,使用makefile的c ++项目
- javascript - 如何将字符串数组转换为二维数组?
- javascript - 要使用 setInterval() 还是 interval()?- 角 11
- algorithm - 找到这个简单算法的循环不变量
- python - 仅在匹配 python 时复制所有行